https://bugzilla.wikimedia.org/show_bug.cgi?id=55230
Web browser: --- Bug ID: 55230 Summary: Using non-ascii file path causes 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/1370/ Reported by: valhallasw Created on: 2011-10-26 20:35:33 Subject: Using non-ascii file path causes UnicodeDecodeError Original description: [user@denix eskarcha]$ python2 login.py unicode test: triggers problem #3081100 Password for user Eskarcha on chakra:en: Logging in to chakra:en as Eskarcha via API. 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 "/home/user/proxectos/chakra/documentación/eskarcha/wikipedia.py", line 5193, in updateCookies self._setupCookies(self._cookies[index], sysop) File "/home/user/proxectos/chakra/documentación/eskarcha/wikipedia.py", line 5164, in _setupCookies f = open(config.datafilepath('login-data', filename), 'w') File "/home/user/proxectos/chakra/documentación/eskarcha/config.py", line 505, in datafilepath return makepath(os.path.join(base_dir, *filename)) File "/usr/lib/python2.7/posixpath.py", line 71, in join path += '/' + b UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 39: ordinal not in range(128)
[user@denix eskarcha]$ python2 version.py Pywikipedia [http] trunk/pywikipedia (r9675, 2011/10/26, 08:57:14) Python 2.7.1 (r271:86832, Jul 24 2011, 00:49:56) [GCC 4.5.3] config-settings: use_api = True use_api_login = True unicode test: triggers problem #3081100
Moving the pywikipediabot directory to an ascii path works as workaround.