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
base: master
Are you sure you want to change the base?
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: |
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'
.