Message211415
posix.unsetenv fails to clear the environment if there's an entry with an empty key.
TEST CASE:
Python 2.7.6 (default, Jan 6 2014, 17:05:19)
[GCC 4.8.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.environ['']='foo'
>>> os.environ.clear()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/path/to/python/2.7.6/lib/python2.7/os.py", line 499, in clear
unsetenv(key)
OSError: [Errno 22] Invalid argument
I believe that os.environ.clear() via unsetenv should handle empty keys. |
|
Date |
User |
Action |
Args |
2014-02-17 13:06:08 | blueyed | set | recipients:
+ blueyed |
2014-02-17 13:06:08 | blueyed | set | messageid: <1392642368.27.0.300660634921.issue20658@psf.upfronthosting.co.za> |
2014-02-17 13:06:08 | blueyed | link | issue20658 messages |
2014-02-17 13:06:07 | blueyed | create | |
|