Page MenuHomePhabricator

pywikibot fails with SVN file formats before 12
Closed, ResolvedPublic

Description

pywikibot has had special support for SVN version 1.6 and earlier, by manually parsing the SVN undocumented entries file (version 11 or earlier).

getversion_svn in the first revision (82d7a63) of core's version.py parsed entries and returned a formatted tag using

tag = '[%s] %s' % (t[0], t[1])

79843a6 (https://gerrit.wikimedia.org/r/#/c/86375/ - Feb 2014) then used this tag value in a URL to github.com to obtain a hash, resulting in an error from github, and an exception in Python. tag was updated for SVN v1.7+, but not v1.6 and earlier.

(after creating a .svn/entries in the version 10 file format)

core$ python pwb.py shell
Welcome to the Pywikibot interactive shell!
>>> import pywikibot
>>> pywikibot.version.getversion_svn()
WARNING: Http response status 400

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File ".../pywikibot/version.py", line 184, in getversion_svn
    hsh = github_svn_rev2hash(tag, rev)
  File ".../pywikibot/version.py", line 166, in github_svn_rev2hash
    dom = xml.dom.minidom.parse(StringIO(data))
  File "/usr/lib64/python2.7/xml/dom/minidom.py", line 1921, in parse
    return expatbuilder.parse(file)
  File "/usr/lib64/python2.7/xml/dom/expatbuilder.py", line 928, in parse
    result = builder.parseFile(file)
  File "/usr/lib64/python2.7/xml/dom/expatbuilder.py", line 207, in parseFile
    parser.Parse(buffer, 0)
ExpatError: undefined entity: line 13, column 20

(the same bug appears in compat.)

Event Timeline

jayvdb raised the priority of this task from to Needs Triage.
jayvdb updated the task description. (Show Details)
jayvdb subscribed.
Restricted Application added subscribers: Aklapper, Unknown Object (MLST). · View Herald TranscriptApr 4 2015, 6:34 AM

Do we need to maintain support for SVN 1.6? It is now unsupported according to http://subversion.apache.org/docs/release-notes/#supported-versions , and 1.7 was released October 11, 2011.

Also worth noting that the entries parser tries to extract the tag (repo) by removing 'svn.wikimedia.org/svnroot/pywikipedia/' , which might be useful when the svn branch is 'trunk', but is not useful when the svn checkout was 'branches/rewrite'

https://svn.wikimedia.org/svnroot/pywikipedia/
https://svn.wikimedia.org/svnroot/pywikipedia/branches/rewrite/

And nobody should be obtaining source code using svn.wikimedia.org ; we give directions for obtaining it via svn using github

https://www.mediawiki.org/wiki/Manual:Pywikibot/Installation#Download_Pywikibot_with_SVN

Note that TortoiseSVN 1.6 does not include a svn binary (or any non-GUI binary), and the 1.7 and 1.8 installers have a 'command line client tools' subpackage in the installer, but it is not installed by default.

jayvdb set Security to None.

I've raised removing support for SVN 1.6 on the mailing list.

Change 201931 had a related patch set uploaded (by John Vandenberg):
Use setuptools for SVN support

https://gerrit.wikimedia.org/r/201931

Change 201931 merged by jenkins-bot:
Use setuptools for SVN support

https://gerrit.wikimedia.org/r/201931

jayvdb claimed this task.

Technically it's only solved for Pywikibot (yet).