-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix UnicodeEncodeError with non ASCII paths on Windows (Python 2) #1252
Conversation
It still breaks some tests. I do not know if there is a possibile simple fix. Perhaps the good move is to use Python 3. |
I close the issue, I will switch to Python 3 :) |
No please leave it open. Python 2 will still be supported for a long time.
|
I'm having troubles reproducing this. I tried: # -*- coding: utf-8 -*-
import psutil
s = '\BaseNamedObjects\C::Users:Mickaël:AppData:Local:Microsoft:Windows:Explorer:thumbcache_32.db!dfMaintainer'
print(repr(psutil._psplatform.cext.win32_QueryDosDevice(s))) ...but it succeeds returning an empty string. |
With Python https://www.python.org/downloads/
|
Python 2 downloads are still around 30% and it's not gonna disappear anytime soon: |
Can we close this issue @giampaolo? |
Yes, I recently dropped 2.7 support so this is not necessary anymore. =) |
OS: Windows.
Python version impacted: 2.
When dealing with non ASCII chars in the path (let's say the username is
Mickaël
), we are blocked on an unicode error:Here,
rawdrive = '\BaseNamedObjects\C::Users:Mickaël:AppData:Local:Microsoft:Windows:Explorer:thumbcache_32.db!dfMaintainer'
.