Happy Monday,
There are strange people who make such links (kindof urlencoded?):
[[Második világháború#Partrasz.C3.A1ll.C3.A1s Szic.C3.ADli.C3.A1ban
.28Huskey hadm.C5.B1velet.29|Huskey hadműveletben]]
So the section title must have been copied from the URL.
Do we have a ready tool to fix these?
--
Bináris
Hello all
>From one of my assignments as a bot operator I have some code which
does template parsing and general text parsing (e.g. Image/File tags).
It is not using regex and thus able to correctly parse nested
templates and other such nasty things. I have written those as library
classes and written tests for them which cover almost all of the code.
I would now really like to contribute that code back to the community.
Would you be interested in adding this code to the pywikibot
framework? If yes, can I send the code to someone for code review or
how do you usually operate?
Greetings
Hannes
PS: wiki userpage is http://en.wikipedia.org/wiki/User:Hannes_R%C3%B6st
Hi,can anyone fix flickrripper.py? It does not work anymore. Probably flickr API was changed recently. See also bug T102860, i get the same error.
Thank you.Dan
Hi,
I ran:
python imagetransfer.py 'File:matplotlib_screenshot.png' -tofamily:lwiki
> -tolang:en -family:commons -lang:commons
and received the output:
/var/www/localhost/htdocs/w/core /var/www/localhost/htdocs/w/core
> ------------------------------------------------------------
> 0. Found image: [[File:Matplotlib screenshot.png]]
> == {{int:filedesc}} ==
> {{Information
> |Description ={{en|1=A screenshot showing [[:en:Matplotlib|Matplotlib]]
> plots of one 3D ''plot_surface'' graph and a polar bar graph resembling the
> Matplotlib logo together with the graphic's python source code opened in a
> text editor.}}
> |Source ={{own}}
> |Date =2014-05-01
> |Author =[[User:Geek3|Geek3]]
> |Permission =
> |other_versions =
> }}
> == {{int:license-header}} ==
> {{self|GFDL|cc-by-3.0}}
> [[Category:Screenshots of software]]
> [[Category:Debian screenshots]]
> [[Category:Created with Matplotlib]]
> ============================================================
> The image is already on Wikimedia Commons.
> /var/www/localhost/htdocs/w/core
Which I found confusing. I have InstantCommons enabled on my Wiki, if
relevant. No File:Matplotlib_screenshot.png page or file exists on my Wiki
(except for the mirror version of the page that exists due to
InstantCommons). Transferring from the English Wikipedia (namely
transferring File:Matplotlib_logo.svg) gives a different message (this one
is an error message):
ERROR: Traceback (most recent call last):
> File
> "/usr/lib64/python2.7/site-packages/pywikibot-2.0rc1.post2-py2.7.egg/pywikibot/data/api.py",
> line 1927, in submit
> body=body, headers=headers)
> File
> "/usr/lib64/python2.7/site-packages/pywikibot-2.0rc1.post2-py2.7.egg/pywikibot/tools/__init__.py",
> line 1248, in wrapper
> return obj(*__args, **__kw)
> File
> "/usr/lib64/python2.7/site-packages/pywikibot-2.0rc1.post2-py2.7.egg/pywikibot/comms/http.py",
> line 244, in request
> r = fetch(baseuri, method, body, headers, **kwargs)
> File
> "/usr/lib64/python2.7/site-packages/pywikibot-2.0rc1.post2-py2.7.egg/pywikibot/comms/http.py",
> line 401, in fetch
> error_handling_callback(request)
> File
> "/usr/lib64/python2.7/site-packages/pywikibot-2.0rc1.post2-py2.7.egg/pywikibot/comms/http.py",
> line 318, in error_handling_callback
> raise request.data
> ReadTimeout: HTTPConnectionPool(host='localhost', port=80): Read timed
> out. (read timeout=30)
> WARNING: Waiting 5 seconds before retrying.
which was repeated until the last line became: "WARNING: Waiting 40 seconds
before retrying". After this was the following error message:
> We got the following warning(s): exists: File Matplotlib_Logo.svg already
> exists.
> Do you want to ignore? ([y]es, [N]o): n
> Upload aborted.
> /var/www/localhost/htdocs/w/core
But the transfer did occur successfully (i.e., File:Matplotlib_Logo.svg now
exists).
Thanks for your time,
Brenton
Hi,
I've been following the guide at mediawiki.org
<https://www.mediawiki.org/wiki/Manual:Pywikibot/Installation> to install
core. Everything I've managed to successfully get through, except the check
at the end, running python pwb.py login gives:
WARNING: Skipped '/pywiki/user-config.py': writeable by others.
WARNING: family and mylang are not set.
Defaulting to family='test' and mylang='test'.
Traceback (most recent call last):
File "scripts/login.py", line 184, in <module>
main()
File "scripts/login.py", line 169, in main
site.login(sysop)
File
"/usr/local/lib/python2.7/dist-packages/pywikibot-2.0rc1.post2-py2.7.egg/pywikibot/site.py",
line 1846, in login
user=self._username[sysop])
File
"/usr/local/lib/python2.7/dist-packages/pywikibot-2.0rc1.post2-py2.7.egg/pywikibot/tools/__init__.py",
line 1248, in wrapper
return obj(*__args, **__kw)
File
"/usr/local/lib/python2.7/dist-packages/pywikibot-2.0rc1.post2-py2.7.egg/pywikibot/login.py",
line 115, in __init__
'wiki_code': self.site.code})
pywikibot.exceptions.NoUsername: ERROR: Username for test:test is undefined.
If you have an account for that site, please add a line to user-config.py:
usernames['test']['test'] = 'myUsername'
<class 'pywikibot.exceptions.NoUsername'>
CRITICAL: Closing network session.
I have created a user-config.py file (which includes a family= and mylang=
line), but this error seems to be saying that I've got the wrong
permissions for it.
Thanks for your time,
Brenton
Hi,
I've been attempting to set up Pywikibot on my Xubuntu 15.04 virtual
machine (which has MediaWiki 1.25.2 installed on it) and as compat wasn't
working for me I decided to switch to core as compat is on the way out from
what I've gathered by the *Compat deprecation* article on mediawiki.org. I
have installed python (2.7.9) and python-pip but when I ran pip install -r
requirements.txt from /pywiki (which I downloaded core to using git) I got
the error:
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in
main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line
288, in run
for req in parse_requirements(filename, finder=finder, options=options,
session=session):
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1632, in
parse_requirements
req = InstallRequirement.from_line(line, comes_from,
prereleases=getattr(options, "pre", None))
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 173, in from_line
return cls(req, comes_from, url=url, prereleases=prereleases)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 71, in __init__
req = pkg_resources.Requirement.parse(req)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line
2929, in parse
reqs = list(parse_requirements(s))
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line
2876, in parse_requirements
"version spec")
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line
2852, in scan_list
raise ValueError(msg, line, "at", line[p:])
ValueError: ("Expected ',' or end-of-list in", "cryptography<=0.8.2 ;
python_version < '2.7'", 'at', " ; python_version < '2.7'")
Storing debug log for failure in /home/fusion809/.pip/pip.log
The contents of pip.log are:
------------------------------------------------------------
/usr/bin/pip run on Fri Aug 21 04:27:18 2015
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in
main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line
288, in run
for req in parse_requirements(filename, finder=finder, options=options,
session=session):
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1632, in
parse_requirements
req = InstallRequirement.from_line(line, comes_from,
prereleases=getattr(options, "pre", None))
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 173, in from_line
return cls(req, comes_from, url=url, prereleases=prereleases)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 71, in __init__
req = pkg_resources.Requirement.parse(req)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line
2929, in parse
reqs = list(parse_requirements(s))
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line
2876, in parse_requirements
"version spec")
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line
2852, in scan_list
raise ValueError(msg, line, "at", line[p:])
ValueError: ("Expected ',' or end-of-list in", "cryptography<=0.8.2 ;
python_version < '2.7'", 'at', " ; python_version < '2.7'")
Can someone please help me with this error?
Thanks for your time,
Brenton
Hello,
I have been using Python 2.7 so far for my scripts, but it is high time to
switch to 3.4. However, when I run this simple script:
https://gist.github.com/alkamid/2a2cb399a193d7fa6254 (getting a page's
content), I get this error:
File "/home/.../wikt/pywikibot/core/pywikibot/comms/http.py", line 293,
in error_handling_callback
raise FatalServerError(str(request.data))
pywikibot.exceptions.FatalServerError: [SSL: CERTIFICATE_VERIFY_FAILED]
certificate verify failed (_ssl.c:600)
(full traceback in the Gist)
It must be something obvious, could you help me out here?
Thanks
alkamid