Message74118
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. |
|
Date |
User |
Action |
Args |
2008-10-01 07:17:21 | a.badger | set | recipients:
+ a.badger |
2008-10-01 07:17:21 | a.badger | set | messageid: <1222845441.08.0.104904424427.issue4006@psf.upfronthosting.co.za> |
2008-10-01 07:17:20 | a.badger | link | issue4006 messages |
2008-10-01 07:17:19 | a.badger | create | |
|