https://bugzilla.wikimedia.org/show_bug.cgi?id=55131
Web browser: --- Bug ID: 55131 Summary: Non-unicode path results in UnicodeDecodeError Product: Pywikibot Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: Unprioritized Component: General Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: legoktm.wikipedia@gmail.com Classification: Unclassified Mobile Platform: ---
Originally from: http://sourceforge.net/p/pywikipediabot/bugs/1648/ Reported by: valhallasw Created on: 2013-07-28 19:36:57.919000 Subject: Non-unicode path results in UnicodeDecodeError Original description:
From an IRC support request:
Traceback (most recent call last): File "login.py", line 436, in <module> main() File "login.py", line 432, in main loginMan.login() File "login.py", line 319, in login cookiedata = self.getCookie(api) File "login.py", line 243, in getCookie self.site.updateCookies(L, self.sysop) File "wikipedia.py", line 6371, in updateCookies self._setupCookies(self._cookies[index], sysop) File "wikipedia.py", line 6342, in _setupCookies f = open(config.datafilepath('login-data', filename), 'w') File "config.py", line 555, in datafilepath return makepath(os.path.join(base_dir, *filename)) File "/usr/lib/python2.7/posixpath.py", line 80, in join path += '/' + b UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 16: ordinal not in range(128)
The pywikipedia folder was in '/.../Télechargements', which is has an accented letter. Moving to a non-accented directory solved the issue.
User is running rewrite; version.py did not yield useful results because it doesn't support git or git nightlies yet...
https://bugzilla.wikimedia.org/show_bug.cgi?id=55131
--- Comment #1 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- in config.datafilepath(*filename), os.path.join(base_dir, *filename) fails if: -. at least one of the argument of os.path.join() is unicode and -. at least one of the argument of os.path.join() has non-ASCII char
https://bugzilla.wikimedia.org/show_bug.cgi?id=55131
Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://sourceforge.net/p/p | |ywikipediabot/bugs/1648
https://bugzilla.wikimedia.org/show_bug.cgi?id=55131
--- Comment #2 from xqt info@gno.de --- *** Bug 55230 has been marked as a duplicate of this bug. ***
https://bugzilla.wikimedia.org/show_bug.cgi?id=55131
Mpaa mpaa.wiki@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |mpaa.wiki@gmail.com Resolution|--- |FIXED
--- Comment #3 from Mpaa mpaa.wiki@gmail.com --- Solved by https://gerrit.wikimedia.org/r/#/c/85029/
Use unicode base path; fixes https://sourceforge.net/p/pywikipediabot/bugs/1648/
execfile does not accept unicode paths, so a manual exec open(...).read() will have to take its job.
Change-Id: I9741c9f97e5a66f0d1af012a82f933f493c64066
pywikipedia-bugs@lists.wikimedia.org