https://bugzilla.wikimedia.org/show_bug.cgi?id=61231
Web browser: --- Bug ID: 61231 Summary: Undefined global WindowsError in version.py Product: Pywikibot Version: core (2.0) Hardware: All OS: All Status: NEW Severity: major Priority: Unprioritized Component: General Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: russblau@hotmail.com Classification: Unclassified Mobile Platform: ---
On Tools Lab, my tool http://tools.wmflabs.org/russbot/csd.py is throwing the following exception (edited for brevity):
/data/project/russbot/cgi-bin/csd.py in () => 37 import pywikibot /shared/pywikipedia/rewrite/pywikibot/__init__.py in () => 418 from .page import Page, ImagePage, Category, Link, User, ItemPage, PropertyPage, Claim /shared/pywikipedia/rewrite/pywikibot/page.py in () => 17 import pywikibot.site /shared/pywikipedia/rewrite/pywikibot/site.py in () => 32 from pywikibot import pagegenerators /shared/pywikipedia/rewrite/pywikibot/pagegenerators.py in () => 31 from pywikibot.comms import http /shared/pywikipedia/rewrite/pywikibot/comms/http.py in () => 62 version=pywikibot.version.getversiondict()) /shared/pywikipedia/rewrite/pywikibot/version.py in getversiondict() 51 else: => 52 (tag, rev, date, hsh) = getversion_git(_program_dir) /shared/pywikipedia/rewrite/pywikibot/version.py in getversion_git(path='/shared/pywikipedia/rewrite') 132 try: 133 subprocess.Popen([cmd], stdout=subprocess.PIPE).communicate() => 134 except WindowsError: 135 # some windows git versions provide git.cmd instead of git.exe 136 cmd = 'git.cmd' WindowsError undefined <type 'exceptions.NameError'>: global name 'WindowsError' is not defined args = ("global name 'WindowsError' is not defined",) message = "global name 'WindowsError' is not defined"
Curiously, I can import pywikibot when starting Python from the command prompt; the exception is only thrown when Python is started from the webserver.
local-russbot@tools-login:~$ version.py Pywikibot: [https] r-p-pywikibot-core.git (ef8fcb5, g2752, 2014/02/11, 06:31:56, ok) Release version: 2.0b1 Python: 2.7.3 (default, Sep 26 2013, 20:03:06) [GCC 4.6.3] unicode test: ok