https://bugzilla.wikimedia.org/show_bug.cgi?id=70703
Bug ID: 70703
Summary: gui depends on idlelib
Product: Pywikibot
Version: core (2.0)
Hardware: All
OS: All
Status: NEW
Severity: major
Priority: Unprioritized
Component: General
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: jayvdb(a)gmail.com
Web browser: ---
Mobile Platform: ---
The GUI module depends on idlelib, which is not specified as a dependency.
Here is an example
$ python pwb.py upload -family:wikidata -lang:test
No input filename given
File or URL where image is now:
https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demons…
The filename on the target wiki will default to:
PNG_transparency_demonstration_1.png
Enter a better name, or press enter to accept:
The suggested description is:
It is not possible to upload a file without a summary/description.
Do you want to change this description? ([Y]es, [n]o, [q]uit) y
Could not load GUI modules: No module named idlelib
Do you want to change this description? ([Y]es, [n]o, [q]uit) y
Could not load GUI modules: No module named idlelib
... etc ..
The result is it isnt possible to add a description.
Either we add a dependency, and/or we fall back gracefully to text based UI.
--
You are receiving this mail because:
You are the assignee for the bug.
https://bugzilla.wikimedia.org/show_bug.cgi?id=72847
Bug ID: 72847
Summary: fileIsShared only works with Wikimedia and Wikitravel
shared repository
Product: Pywikibot
Version: core (2.0)
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: network
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: jayvdb(a)gmail.com
Web browser: ---
Mobile Platform: ---
Setting up a shared_image_repository for a family requires adding logic to
page.fileIsShared, which is currently:
if not self.site.has_image_repository:
return False
elif 'wikitravel_shared' in self.site.shared_image_repository():
return self.fileUrl().startswith(
u'http://wikitravel.org/upload/shared/')
else:
return self.fileUrl().startswith(
'https://upload.wikimedia.org/wikipedia/commons/')
--
You are receiving this mail because:
You are the assignee for the bug.
https://bugzilla.wikimedia.org/show_bug.cgi?id=72845
Bug ID: 72845
Summary: generate_family_file.py fails with exception trace
Product: Pywikibot
Version: core (2.0)
Hardware: All
OS: All
Status: NEW
Severity: major
Priority: Unprioritized
Component: General
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: jayvdb(a)gmail.com
Web browser: ---
Mobile Platform: ---
fails badly if given a URL which isnt the front page of a wiki
$ python ./generate_family_file.py http://genealogy.net/ gene
Generating family file from http://genealogy.net/
Traceback (most recent call last):
File "./generate_family_file.py", line 317, in <module>
FamilyFileGenerator(*sys.argv[1:]).run()
File "./generate_family_file.py", line 93, in run
w = Wiki(self.base_url)
File "./generate_family_file.py", line 258, in __init__
self._parse_post_117(wp, fromurl)
File "./generate_family_file.py", line 286, in _parse_post_117
apipath = wp.edituri.split("?")[0]
AttributeError: WikiHTMLPageParser instance has no attribute 'edituri'
--
You are receiving this mail because:
You are the assignee for the bug.
https://bugzilla.wikimedia.org/show_bug.cgi?id=72896
Bug ID: 72896
Summary: generate_family_file.py creates dodgy syntax for
semantic-mediawiki.org
Product: Pywikibot
Version: core (2.0)
Hardware: All
OS: All
Status: NEW
Severity: major
Priority: Unprioritized
Component: General
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: jayvdb(a)gmail.com
Web browser: ---
Mobile Platform: ---
The family file generator believes there is a language 'sw', but the writes a
family class with two 'en' langs, which is invalid dict syntax.
$ python ./generate_family_file.py https://www.semantic-mediawiki.org/wiki/
semantic-mw
Generating family file from https://www.semantic-mediawiki.org/wiki/
==================================
api url: https://semantic-mediawiki.org/w/api.php
MediaWiki version: 1.22.3
==================================
Determining other languages...sw
There are 2 languages available.
Do you want to generate interwiki links? This might take a long time.
([y]es/[N]o/[e]dit)y
Loading wikis...
* sw... downloaded
* en... in cache
Writing pywikibot/families/semantic-mw_family.py...
$ cat pywikibot/families/semantic-mw_family.py
# -*- coding: utf-8 -*-
"""
This family file was auto-generated by $Id:
185033971c163ea46b2b1904773b8c407069a4d0 $
Configuration parameters:
url = https://www.semantic-mediawiki.org/wiki/
name = semantic-mw
Please do not commit this to the Git repository!
"""
from pywikibot import family
class Family(family.Family):
def __init__(self):
family.Family.__init__(self)
self.name = 'semantic-mw'
self.langs = {
'en': 'semanticweb.org',
'en': 'semantic-mediawiki.org',
}
def scriptpath(self, code):
return {
'en': '',
'en': '/w',
}[code]
def version(self, code):
return {
'en': u'1.20.2',
'en': u'1.22.3',
}[code]
It isnt quite invalid syntax, but it is dodgy.
The family file 'works' because semantic-mediawiki.org is second in that list,
and all supported version of python return the second entry with the same key.
$ python2.6 pwb.py shell
Welcome to the Pywikibot interactive shell!
>>> import pywikibot
>>> s = pywikibot.Site('en', 'semantic-mw')
>>> s.family.langs
{'en': 'semantic-mediawiki.org'}
>>> {
... 'en': u'1.20.2',
... 'en': u'1.22.3',
... }
{'en': u'1.22.3'}
--
You are receiving this mail because:
You are the assignee for the bug.
https://bugzilla.wikimedia.org/show_bug.cgi?id=69204
Bug ID: 69204
Summary: weblinkchecker.py uses a fake user-agent
Product: Pywikibot
Version: core (2.0)
Hardware: All
OS: All
Status: NEW
Severity: major
Priority: Unprioritized
Component: network
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: jayvdb(a)gmail.com
Web browser: ---
Mobile Platform: ---
weblinkchecker.py (core) contains this comment:
# we fake being Firefox because some webservers block unknown
# clients, e.g. https://images.google.de/images?q=Albit gives a 403
# when using the PyWikipediaBot user agent.
'User-agent': 'Mozilla/5.0 (X11; U; Linux i686; de; rv:1.8) Gecko/20051128
SUSE/1.5-0.1 Firefox/1.5',
Which was added to core in Jan 2007:
https://www.mediawiki.org/wiki/Special:Code/pywikipedia/3165
Faking the user-agent should be an option, default disabled, or only used for
servers known to be problematic.
--
You are receiving this mail because:
You are the assignee for the bug.
https://bugzilla.wikimedia.org/show_bug.cgi?id=72120
Bug ID: 72120
Summary: pagegenerators.GeneratorFactory() uses default site,
even when command line args havent been processed
Product: Pywikibot
Version: core (2.0)
Hardware: All
OS: All
Status: NEW
Severity: major
Priority: Unprioritized
Component: General
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: jayvdb(a)gmail.com
Web browser: ---
Mobile Platform: ---
In the current code, pywikibot.handleArgs() must be called before
pagegenerators.GeneratorFactory(), as
pagegenerators.GeneratorFactory.__init__() calls pywikibot.Site().
If pagegenerators.GeneratorFactory() is called first, the default site per
user-config is used, and command line args (-family -lang -user) are ignored.
See bug 63800.
This could be almost completely fixed by changing GeneratorFactory.site to be a
property, loaded on access. That prevents the typical coding bug which look
like:
genFactory = pagegenerators.GeneratorFactory()
for arg in pywikibot.handleArgs():
if genFactory.handleArg(arg):
pass
The current solution is to use and promote the pattern:
local_args = pywikibot.handleArgs()
genFactory = pagegenerators.GeneratorFactory()
for arg in local_args:
if genFactory.handleArg(arg):
pass
However it doesnt prevent this:
genFactory = pagegenerators.GeneratorFactory()
genFactory.handleArg('-file:' + filename):
...
pywikibot.handleArgs()
One way to prevent that is to raise an exception in pywikibot.handleArgs if it
is called after pywikibot.Site() has instantiated a default site, and possibly
only if -family/-lang/-user are supplied on the command line.
Another approach (very dodgy) is for pywikibot to know which Site object is the
'default' site, and pywikibot.handleArgs() change that object if
-family/-lang/-user are supplied on the command line.
--
You are receiving this mail because:
You are the assignee for the bug.
https://bugzilla.wikimedia.org/show_bug.cgi?id=64503
Bug ID: 64503
Summary: Add time to harvest_template.py
Product: Pywikibot
Version: core (2.0)
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: Wikidata
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: maarten(a)mdammers.nl
Depends on: 64501, 64502
Web browser: ---
Mobile Platform: ---
Time is one of the new Wikibase datatypes. harvest_template.py should support
importing time.
https://www.wikidata.org/wiki/User:Underlying_lk/harvest_template_old.py can be
used as reference, but that code combines everything. I split it up in multiple
bugs.
--
You are receiving this mail because:
You are the assignee for the bug.
https://bugzilla.wikimedia.org/show_bug.cgi?id=72680
Bug ID: 72680
Summary: 'user-config.py' not found if runs with cron
Product: Pywikibot
Version: core (2.0)
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: General
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: l.rabinelli+bugzilla(a)gmail.com
Web browser: ---
Mobile Platform: ---
After Ic8ac542919e18ad16458d21e0f9713ade899b964 if I try to run a script via
command line (foreground), it's executed correctly.
Eg: python pwb.py <script_name>
But when I schedule the same script via cron, it terminates with this error:
NOTE: 'user-config.py' was not found!
Please follow the prompts to create it:
Traceback (most recent call last):
File "/data/project/betabot/core/pwb.py", line 162, in <module>
[])
File "/data/project/betabot/core/pwb.py", line 74, in run_python_file
source = open(filename).read()
IOError: [Errno 2] No such file or directory: 'generate_user_files.py'
This is my version:
Pywikibot: [https] r-pywikibot-core.git (178e01a, g4377, 2014/10/26, 22:42:22,
OUTDATED)
Release version: 2.0b2
httplib2 version: 0.9
certificate test: ok
Python: 2.7.3 (default, Feb 27 2014, 19:58:35)
[GCC 4.6.3]
unicode test: ok
Please, ask me if you need more information.
--
You are receiving this mail because:
You are the assignee for the bug.
https://bugzilla.wikimedia.org/show_bug.cgi?id=73196
Bug ID: 73196
Summary: category.py more - add "-noredirect" option
Product: Pywikibot
Version: core (2.0)
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: Unprioritized
Component: category.py
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: steen(a)thomassen.net
Web browser: ---
Mobile Platform: ---
Add a -noredirect option as like movepages.py's. If bot has
suppressredirect-rights, so source pages not need to be deleted after move.
--
You are receiving this mail because:
You are the assignee for the bug.
https://bugzilla.wikimedia.org/show_bug.cgi?id=72093
Bug ID: 72093
Summary: commands with colon fails
Product: Pywikibot
Version: core (2.0)
Hardware: All
OS: All
Status: NEW
Severity: critical
Priority: Unprioritized
Component: General
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: jan.dudik(a)gmail.com
Web browser: ---
Mobile Platform: ---
When running script with pagegenerators containing character ":", bot fails:
I:\py\rewrite>pwb.py newitem -catr:údržba_Wikipedie
Retrieving 50 pages from wikipedia:cs.
>>> Wikipedie:Požadované články <<<
[[cs:Wikipedie:Požadované články]] already has an item: [[wikidata:Q4664111]].
...
I:\py\rewrite>pwb.py newitem -catr:údržba:Wikidata
Traceback (most recent call last):
File "I:\py\rewrite\pwb.py", line 164, in <module>
run_python_file(fn, argv, argvu)
File "I:\py\rewrite\pwb.py", line 69, in run_python_file
exec(compile(source, filename, "exec"), main_mod.__dict__)
File "I:\py\rewrite\scripts\newitem.py", line 149, in <module>
main()
File "I:\py\rewrite\scripts\newitem.py", line 135, in main
elif gen.handleArg(arg):
File "I:\py\rewrite\pywikibot\pagegenerators.py", line 415, in handleArg
gen = self.getCategoryGen(arg, len('-catr'), recurse=True)
File "I:\py\rewrite\pywikibot\pagegenerators.py", line 283, in getCategoryGen
defaultNamespace=14))
File "I:\py\rewrite\pywikibot\tools.py", line 529, in wrapper
return obj(*__args, **__kw)
File "I:\py\rewrite\pywikibot\page.py", line 1951, in __init__
if self.namespace() != 14:
File "I:\py\rewrite\pywikibot\page.py", line 158, in namespace
return self._link.namespace
File "I:\py\rewrite\pywikibot\page.py", line 4141, in namespace
self.parse()
File "I:\py\rewrite\pywikibot\page.py", line 4050, in parse
newsite = self._site.interwiki(prefix)
File "I:\py\rewrite\pywikibot\site.py", line 600, in interwiki
"'{0}' is not an interwiki prefix.".format(prefix))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfa' in position 0:
ordinal not in range(128)
<type 'exceptions.UnicodeEncodeError'>
CRITICAL: Waiting for 1 network thread(s) to finish. Press ctrl-c to abort
I:\py\rewrite>
--
You are receiving this mail because:
You are the assignee for the bug.