jayvdb created this task. jayvdb added a subscriber: jayvdb. jayvdb added a project: pywikibot-core. Restricted Application added subscribers: Aklapper, pywikipedia-bugs.
TASK DESCRIPTION Unicode directory names cause problems whether invoked via pwb.py or directly. ``` C:\pywikibot\Häuser-core>python pwb.py shell Traceback (most recent call last): File "pwb.py", line 117, in <module> os.path.join(rewrite_path, 'pywikibot', 'compat'), File "C:\Python279\lib\ntpath.py", line 84, in join result_path = result_path + p_path UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 12: ordinal not in range(128) ```
``` C:\pywikibot\Häuser-core>set PYTHONPATH=. C:\pywikibot\Häuser-core>python scripts\shell.py Traceback (most recent call last): File "scripts\shell.py", line 44, in <module> main(*args) File "scripts\shell.py", line 30, in main import pywikibot File "C:\pywikibot\Hõuser-core\pywikibot__init__.py", line 32, in <module> from pywikibot import config2 as config File "C:\pywikibot\Hõuser-core\pywikibot\config2.py", line 307, in <module> register_families_folder(os.path.join(os.path.dirname(__file__), 'families') ) File "C:\Python279\lib\ntpath.py", line 84, in join result_path = result_path + p_path UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 12: ordinal not in range(128) ```
Even if we can solve those, we then have the problem of paths in the environment:
The solution doesnt look good https://measureofchaos.wordpress.com/2011/03/04/python-on-windows-unicode-en...
TASK DETAIL https://phabricator.wikimedia.org/T96127
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: jayvdb Cc: pywikipedia-bugs, jayvdb, Aklapper
XZise added a subscriber: XZise. XZise added a comment.
Wow… that is a serious shortcoming on Python 2. That you have to patch your way into using Unicode environment :/ I mean supporting `putenv()` with `unicode` should simply use the Unicode functionality (as described in the blog you mention). Okay `getenv()` is a bit more problematic as it can't simply return `unicode` :(
So I guess we need some logic in `tools` or so which allows us to set and get `unicode` environment variables and use that instead of `os.environ`.
TASK DETAIL https://phabricator.wikimedia.org/T96127
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: XZise Cc: XZise, jayvdb, Aklapper, pywikipedia-bugs
pywikipedia-bugs@lists.wikimedia.org