This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author a.badger
Recipients a.badger
Date 2008-10-01.07:17:19
SpamBayes Score 5.004631e-10
Marked as misclassified No
Message-id <1222845441.08.0.104904424427.issue4006@psf.upfronthosting.co.za>
In-reply-to
Content
On a Linux system with a locale setting whose encoding is utf-8, if you
set an environment variable to have a non-utf-8 chanacter, that
environment variable silently does not appear in os.environ::

mkdir ñ
convmv -f utf-8 -t latin-1 --notest ñ
for i in * ; do export PATH=$PATH:$i ; done
echo $PATH
/usr/lib/qt-3.3/bin:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/bin:/usr/bin:/bin:/home/badger/bin:�
python3.0
Python 3.0rc1 (r30rc1:66499, Sep 28 2008, 08:21:09) 
[GCC 4.3.0 20080428 (Red Hat 4.3.0-8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.environ['PATH']
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.0/os.py", line 389, in __getitem__
    return self.data[self.keymap(key)]
KeyError: 'PATH'

I'm uncertain of the impact of this.  It was brought up in a discussion
of sending non-ASCii data to a CGI-WSGI script where the data would be
transferred via os.environ.
History
Date User Action Args
2008-10-01 07:17:21a.badgersetrecipients: + a.badger
2008-10-01 07:17:21a.badgersetmessageid: <1222845441.08.0.104904424427.issue4006@psf.upfronthosting.co.za>
2008-10-01 07:17:20a.badgerlinkissue4006 messages
2008-10-01 07:17:19a.badgercreate