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
Problem with invalidly-encoded command-line arguments (Unix) #47273
Comments
The error message has no newline at the end: $ LANG=en_GB.UTF-8 python3.0 test.py $'\xff'
Could not convert argument 2 to string$ Seriously, though: is this the intended behaviour? If the Could sys.argv not provide bytes objects for those arguments, |
That os.listdir still uses bytes should be changed as well. Both file |
Hmm, yes, I see that the open() builtin doesn't accept bytes So what *is* os.listdir() supposed to do when it finds an |
The issue with unrepresentable file names hasn't been decided yet. One |
What? open() builtin, io.open() and os.open() accept bytes filename.
os.listdir(str)->str raises an exception on undecodable filename,
Which database? It sounds like a different issue. It's always a good |
It's yet another special case of the more general issue, which is that Since Python 3 strings must be text, they cannot generally be used to My use of Python is chiefly general-purpose scripting on Linux. I'm bothered by Martin's comment:
I hope that this is nothing more than his expression of dismay that such |
@ Victor Stinner: Yes, the behaviour of those functions is as you By the password database, I mean /etc/passwd or replacements that |
Please only discuss one issue at the time in the bug tracker. This |
I started to patch pwd module to return bytes instead of unicode, but I didn't |
I believe the title problem is solved by PEP-383 in py3k trunk. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: