Author dalke
Recipients arigo, christian.heimes, dalke, loewis, rhettinger, tds333
Date 2008-01-13.13:08:46
SpamBayes Score 0.00469426
Marked as misclassified No
Message-id <1200229728.71.0.130711771557.issue1367711@psf.upfronthosting.co.za>
In-reply-to
Content
Ahh, so the bug here that the environ dict should use neither UserDict nor 
dict, it should implement the core {get,set,del}item and keys and use 
DictMixin.

Martin mentioned that the patch doesn't support setdefault.  He didn't note 
though that the current code also doesn't support the dictionary interface 
consistently.  This shows a problem with popitem.

>>> import os
>>> os.environ["USER"]
'dalke'
>>> os.environ["USER"] = "nobody"
>>> os.system("echo $USER")
nobody
0
>>> del os.environ["USER"]
>>> os.system("echo $USER")

0
>>> os.environ["USER"] = "dalke"
>>> while os.environ: print os.environ.popitem()
... 
('GROUP', 'staff')
('XDG_DATA_HOME', '/Users/dalke/.local/share')
('TERM_PROGRAM_VERSION', '133')
('CVS_RSH', 'ssh')
('LOGNAME', 'dalke')
('USER', 'dalke')
    ... removed for conciseness ...
('QTDIR', '/usr/local/qt')
>>> os.system("echo $USER")
dalke
0
>>> 

Not enough people know about DictMixin.
History
Date User Action Args
2008-01-13 13:08:48dalkesetspambayes_score: 0.00469426 -> 0.00469426
recipients: + dalke, loewis, arigo, rhettinger, tds333, christian.heimes
2008-01-13 13:08:48dalkesetspambayes_score: 0.00469426 -> 0.00469426
messageid: <1200229728.71.0.130711771557.issue1367711@psf.upfronthosting.co.za>
2008-01-13 13:08:47dalkelinkissue1367711 messages
2008-01-13 13:08:46dalkecreate