This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

msg 333100 created
issue 35670 created
clear this message

classification
Title: os functions return '??' for unicode characters in paths on windows
Type: behavior Stage: resolved
Components: Windows Versions: Python 2.7
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: Creation Elemental, paul.moore, serhiy.storchaka, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2019-01-06 10:26 by Creation Elemental, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg333100 - (view) Author: Creation Elemental (Creation Elemental) Date: 2019-01-06 10:26
I have a few files that contain emojis in their names, and also a folder that has such. Commands like `os.getcwd`, `os.listdir`, `os.path.realpath`, etc. will cause this to happen. However, this is only, as far as I can tell, happening on pure windows distributions. This does not happen in the cygwin64 version I have, nor does it happen in python3.

For example, say you have a folder simply called '🔭'. If you run python inside of it and run `os.getcwd()` you will simply get `'??'` as the result. This breaks MANY of my programs that depend on knowing exactly where they are, and knowing the contents of a directory to pass to other functions.
msg333106 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2019-01-06 12:27
This is a known issue. See for example issue13247 and issue16656. It cannot be fixed in Python 2. The only thing that can be done is to document it (see issue16700).
msg333118 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-01-06 20:46
To be more clear, the fix is literally Python 3 and the str/bytes change. You've discovered one of the reasons that was necessary.
History
Date User Action Args
2022-04-11 14:59:10adminsetgithub: 79851
2019-01-06 20:46:19steve.dowersetmessages: + msg333118
2019-01-06 12:27:04serhiy.storchakasetstatus: open -> closed

nosy: + serhiy.storchaka
messages: + msg333106

resolution: wont fix
stage: resolved
2019-01-06 10:26:47Creation Elementalcreate