Martin v. Löwis mar...@v.loewis.de added the comment:
Antoine: Python cannot possibly know whether a command line argument is meant
as a file name or as some other text, and what encoding the receiving
application will apply to it (if any).
I agree it's best to have all IO encodings being the
Antoine Pitrou pit...@free.fr added the comment:
Antoine: Python cannot possibly know whether a command line argument
is meant as a file name or as some other text, and what encoding the
receiving application will apply to it (if any).
I understand. But practicality seems to suggest that,
Martin v. Löwis mar...@v.loewis.de added the comment:
The most likely values to be non-ASCII are, therefore, file paths. So it
would make sense to also use the filesystem encoding for environment
variables (so as to satisfy the common case).
-1. Environment variables are typically set in a
Antoine Pitrou pit...@free.fr added the comment:
-1. Environment variables are typically set in a text editor or on
the command line, so they will typically have the locale's encoding.
Fair enough.
If the mere existence of the fsname encoding leads to that much
confusion, I think I also
Martin v. Löwis mar...@v.loewis.de added the comment:
If the mere existence of the fsname encoding leads to that much
confusion, I think I also support its removal.
Well, the fsname encoding has a hardwired value under OS X (regardless
of the locale), which kind of justifies its existence,
Stephen Hansen me+pyt...@ixokai.io added the comment:
This issue seems to be the cause of issue4388 -- and cmdline_encoding-2.patch
fixes it, fwiw.
--
nosy: +ixokai
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9992
Antoine Pitrou pit...@free.fr added the comment:
The important point is that we have to use the same encoding to decode
and encode command line arguments.
I don't think I agree with this. It's only important when you run a Python
interpreter using subprocess, but the point of using
STINNER Victor victor.stin...@haypocalc.com added the comment:
See also #10014: sys.path[0] is decoded from the locale encoding instead of the
fileystem encoding.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9992
STINNER Victor victor.stin...@haypocalc.com added the comment:
The problem with command line arguments is that they don't necessarily
have just one encoding (just like env vars may well use more than
one encoding) on Unix platforms.
The issue #8776 proposes the creation of sys.argv.
When
Marc-Andre Lemburg m...@egenix.com added the comment:
STINNER Victor wrote:
STINNER Victor victor.stin...@haypocalc.com added the comment:
The problem with command line arguments is that they don't necessarily
have just one encoding (just like env vars may well use more than
one
STINNER Victor victor.stin...@haypocalc.com added the comment:
Extract of an interesting message (msg111432) of #8775 (issue specific to Mac
OS X):
A system where the filesystem encoding doesn't match the locale encoding is
hard to get right. While it would be possible to add
STINNER Victor victor.stin...@haypocalc.com added the comment:
A system where the filesystem encoding doesn't match the locale
encoding is hard to get right.
Mmmh. The problem is maybe that the new PYTHONFSENCODING environment variable
(added by #8622) introduced an horrible inconstency
12 matches
Mail list logo