Author lemburg
Recipients Arfrever, ezio.melotti, gregory.p.smith, lemburg, loewis, vstinner
Date 2010-04-26.11:06:45
SpamBayes Score 1.17628e-13
Marked as misclassified No
Message-id <4BD573C4.7060104@egenix.com>
In-reply-to <1272278962.99.0.0792943418506.issue8514@psf.upfronthosting.co.za>
Content
STINNER Victor wrote:
> 
> STINNER Victor <victor.stinner@haypocalc.com> added the comment:
> 
> Oh! In Python3, ntpath.expanduser() supports bytes path and uses sys.getfilesystemencoding() to encode an unicode environment variable to a byte string.
> 
> Should we remove bytes path support in ntpath.expanduser(), or support bytes in ntpath.fsencode()/.fsdecode()?
> 
> (sys.getfilesystemencoding() is "mbcs" on Windows)

I don't see what environment variables have to do with the file
system.

Those are two different contexts and thus also require two different
approaches to the problem.

Command line parameters are another area, where an encoding
comes into play, but this again does not have to coincide with the
file system encoding.

Also note that "mbcs" on Windows is a meta-encoding. The
implementation of that encoding depends on the locale used by
the Windows user. It's just a coincidence that this may actually
work for the environment variables on Windows as well, but there's
no guarantee.

On Unix, you often have the case that the environment variables
use mixed encodings, e.g. the CGI interface is a good example
where this happens per definition. The CGI environment can
includes file system paths, data encoded in Latin-1 (or some
other encoding), etc.

See http://www.ietf.org/rfc/rfc3875.txt for details.

Environment variables are also commonly used to interface
to external programs from daemons, e.g. postfix, procmail
and others use environment variables to communicate with
external helper applications.
History
Date User Action Args
2010-04-26 11:06:47lemburgsetrecipients: + lemburg, loewis, gregory.p.smith, vstinner, ezio.melotti, Arfrever
2010-04-26 11:06:46lemburglinkissue8514 messages
2010-04-26 11:06:45lemburgcreate