Author blueyed
Recipients blueyed
Date 2014-02-17.13:06:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1392642368.27.0.300660634921.issue20658@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2014-02-17 13:06:08blueyedsetrecipients: + blueyed
2014-02-17 13:06:08blueyedsetmessageid: <1392642368.27.0.300660634921.issue20658@psf.upfronthosting.co.za>
2014-02-17 13:06:08blueyedlinkissue20658 messages
2014-02-17 13:06:07blueyedcreate