[issue8603] Create a bytes version of os.environ and getenvb()
report at bugs.python.org
Mon May 3 23:04:34 CEST 2010
Marc-Andre Lemburg <mal at egenix.com> added the comment:
Martin v. Löwis wrote:
> Martin v. Löwis <martin at v.loewis.de> added the comment:
>> Please see the discussion on http://bugs.python.org/issue8514
>> for details.
> I can't see any report of actual breakage in that report, only claims of
> potential breakage (with no supporting examples)
Set your CODESET to ASCII and watch the surrogate escaping
begin... seriously, Martin, if you've ever worked with CGI
or WSGI or FastCGI or SCGI or any of the many other protocols
that use the OS environment for passing data between processes,
it doesn't take much imagination to come up with examples
that fail left and right.
Here's one (RFC 3875, sections 4.1.7 and 4.1.5):
LANG = 'en_US.utf8'
CONTENT_TYPE = 'application/x-www-form-urlencoded'
QUERY_STRING = 'type=example&name=Löwis'
PATH_INFO = '/home/lÃ¶wis/bin/mycgi.py'
(HTML uses Latin-1 as default encoding and so do many of the
protocols invented for it !)
The file system encoding simply doesn't relate to the OS
environment at all - it's just a collection of name=value mappings
with no explicit encoding information. It may be a good guess,
but that's it.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list