Last modified: 2014-06-26 15:12:45 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T68687, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 66687 - SVN parse error
SVN parse error
Status: RESOLVED FIXED
Product: Pywikibot
Classification: Unclassified
General (Other open bugs)
compat-(1.0)
PC Windows 7
: Unprioritized major
: ---
Assigned To: Pywikipedia bugs
:
Depends on: 66951
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-16 20:51 UTC by msh210
Modified: 2014-06-26 15:12 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description msh210 2014-06-16 20:51:32 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.)
Comment 1 Gerrit Notification Bot 2014-06-17 08:48:58 UTC
Change 140069 had a related patch set uploaded by John Vandenberg:
(bug 66687) ExpatError obtaining version from SVN

https://gerrit.wikimedia.org/r/140069
Comment 2 John Mark Vandenberg 2014-06-17 09:11:08 UTC
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.
Comment 3 msh210 2014-06-19 16:01:22 UTC
Does anyone have a workaround for me, please, so I can run scripts now and until this is fixed?
Comment 4 msh210 2014-06-19 16:07:55 UTC
(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.
Comment 5 John Mark Vandenberg 2014-06-19 16:23:37 UTC
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.
Comment 6 msh210 2014-06-19 19:15:49 UTC
(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.
Comment 7 John Mark Vandenberg 2014-06-19 21:53:44 UTC
I would appreciate knowing the program output from both workarounds.
Comment 8 Gerrit Notification Bot 2014-06-20 00:08:35 UTC
Change 140069 merged by jenkins-bot:
(bug 66687) ExpatError obtaining version from SVN

https://gerrit.wikimedia.org/r/140069
Comment 9 msh210 2014-06-20 02:09:05 UTC
(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'
Comment 10 xqt 2014-06-26 10:11:47 UTC
wikipediatools bug is noted at bug 66951 and solved there
Comment 11 msh210 2014-06-26 15:06:39 UTC
(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?
Comment 12 xqt 2014-06-26 15:12:45 UTC
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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links