Last modified: 2014-06-26 15:12:45 UTC
C:\...\pywikipedia\ua_bug.py: import wikipedia print wikipedia.useragent C:\...\pywikipedia>python ua_bug.py Traceback (most recent call last): File "ua_bug.py", line 1, in <module> import wikipedia File "C:\...\pywikipedia\wikipedia.py", line 6023, in < module> versionrev=(version.getversiondict()["rev"]) File "C:\...\pywikipedia\pywikibot\version.py", line 50 , in getversiondict (tag, rev, date, hsh) = getversion_svn(_program_dir) File "C:\...\pywikipedia\pywikibot\version.py", line 14 5, in getversion_svn dom = xml.dom.minidom.parse(resp) File "C:\Program Files\Python27\lib\xml\dom\minidom.py", line 1921, in parse return expatbuilder.parse(file) File "C:\Program Files\Python27\lib\xml\dom\expatbuilder.py", line 928, in par se result = builder.parseFile(file) File "C:\Program Files\Python27\lib\xml\dom\expatbuilder.py", line 207, in par seFile parser.Parse(buffer, 0) xml.parsers.expat.ExpatError: undefined entity: line 13, column 20 (I'm calling this bug "SVN parse error" on the advice of [[w:en:user:John Vandenberg]]. I don't know on what basis he so advised.)
Change 140069 had a related patch set uploaded by John Vandenberg: (bug 66687) ExpatError obtaining version from SVN https://gerrit.wikimedia.org/r/140069
The patch above only 'hides' the problem. It would be good if you could add a line print rev at line 139 to pywikibot/version.py , so it looks like this print rev conn = httplib.HTTPSConnection('github.com') and report what it prints out.
Does anyone have a workaround for me, please, so I can run scripts now and until this is fixed?
(In reply to John Mark Vandenberg from comment #2) > It would be good if you could add a line > > print rev > > at line 139 to pywikibot/version.py , so it looks like this > > print rev > conn = httplib.HTTPSConnection('github.com') > > and report what it prints out. If that was addressed to me and was assuming my state of affairs as it was I reported the bug (no change in software) -- neither of which I know to be the case -- then it prints out nothing.
Interesting. (In reply to msh210 from comment #3) > Does anyone have a workaround for me, please, so I can run scripts now and > until this is fixed? Sure! This change should fix the problem: https://gerrit.wikimedia.org/r/#/c/140069/1/pywikibot/version.py,cm If that doesnt work, in wikipedia.py, line 6021, replace setUserAgent(USER_AGENT_FORMAT % dict( script=('-'.join(version.get_executing_script())), versionrev=(version.getversiondict()["rev"]) )) with setUserAgent('Pywikibot 1.0/compat bug 66687') (In reply to msh210 from comment #4) > .. > If that was addressed to me and was assuming my state of affairs as it was I > reported the bug (no change in software) -- neither of which I know to be > the case -- then it prints out nothing. Yes it was. I wasnt able to reproduce this problem on Linux, so I will need your help (or that of anyone else who can reproduce this bug) to find the problem. Thanks for doing that. That helps me find the problem. I'll come back soon with another debugging request.
(In reply to John Mark Vandenberg from comment #5) > I'll come back soon with another debugging request. By all means. Meanwhile, note that your two workarounds didn't work around; if it helps you to know the program output for either or both, lemme know.
I would appreciate knowing the program output from both workarounds.
Change 140069 merged by jenkins-bot: (bug 66687) ExpatError obtaining version from SVN https://gerrit.wikimedia.org/r/140069
(In reply to John Mark Vandenberg from comment #7) > I would appreciate knowing the program output from both workarounds. (In reply to John Mark Vandenberg from comment #5) > This change should fix the problem: > > https://gerrit.wikimedia.org/r/#/c/140069/1/pywikibot/version.py,cm C:\...\pywikipedia>python msh210.py Traceback (most recent call last): File "msh210.py", line 39, in <module> import catlib File "C:\...\pywikipedia\catlib.py", line 20, in <module> import wikipedia as pywikibot File "C:\...\pywikipedia\wikipedia.py", line 6023, in <module> versionrev=(version.getversiondict()["rev"]) File "C:\...\pywikipedia\pywikibot\version.py", line 55, in getversiondict (tag, rev, date, hsh) = getversion_nightly() File "C:\...\pywikipedia\pywikibot\version.py", line 202, in getversion_nightly data = open(os.path.join(wikipediatools.get_base_dir(), 'version')) NameError: global name 'wikipediatools' is not defined (In further reply to John Mark Vandenberg from comment #5) > If that doesnt work, in wikipedia.py, line 6021, replace > > setUserAgent(USER_AGENT_FORMAT % dict( > script=('-'.join(version.get_executing_script())), > versionrev=(version.getversiondict()["rev"]) > )) > > with > > setUserAgent('Pywikibot 1.0/compat bug 66687') C:\...\pywikipedia>python msh210.py Traceback (most recent call last): File "msh210.py", line 39, in <module> import catlib File "C:\...\pywikipedia\catlib.py", line 20, in <module> import wikipedia as pywikibot File "C:\...\pywikipedia\wikipedia.py", line 9983, in <module> writeToCommandLogFile() File "C:\...\pywikipedia\wikipedia.py", line 9782, in writeToCommandLogFile commandLogFile = codecs.open(commandLogFilename, 'w', 'utf-8') File "C:\Program Files\Python27\lib\codecs.py", line 881, in open file = __builtin__.open(filename, mode, buffering) IOError: [Errno 13] Permission denied: u'C:\\...\\pywikipedia\\logs\\commands.log'
wikipediatools bug is noted at bug 66951 and solved there
(In reply to xqt from comment #10) > wikipediatools bug is noted at bug 66951 and solved there That bug is still marked patch_to_review and this one has now been marked resolved, which I don't understand. In any event, can someone clarify the resolvedness of this bug? Specifically: If I re-download the nightly compat, will I be able to run my scripts? If not, then how can I run them?
It's not part of the nightly dump until the patch is committed after the review process. You may get the patched file from https://git.wikimedia.org/blob/pywikibot%2Fcompat/1f55aea336bda2349fdc73fe3ee0f75deacb3218/pywikibot%2Fversion.py