jenkins-bot has submitted this change and it was merged.
Change subject: Decode __file__ using filesystem encoding ......................................................................
Decode __file__ using filesystem encoding
If the python packages loaded are in a non-ASCII named directory, pywikibot on Python 2.x fails with UnicodeDecodeError.
Decode the __file__ values with sys.getfilesystemencoding().
Bug: 69476 Change-Id: I74c8d08b48b4f03ef38ccdbfce8ff3e5886289d5 --- M pywikibot/version.py 1 file changed, 3 insertions(+), 0 deletions(-)
Approvals: Mpaa: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/version.py b/pywikibot/version.py index 7e232a1..e82f0c5 100644 --- a/pywikibot/version.py +++ b/pywikibot/version.py @@ -346,6 +346,9 @@ if '__init__.py' in path: path = path[0:path.index('__init__.py')]
+ if sys.version_info[0] == 2: + path = path.decode(sys.getfilesystemencoding()) + info['path'] = path assert(path not in paths) paths[path] = name
pywikibot-commits@lists.wikimedia.org