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 | dalke |
|---|---|
| Recipients | arigo, christian.heimes, dalke, loewis, rhettinger, tds333 |
| Date | 2008年01月13日.13:08:46 |
| SpamBayes Score | 0.004694262 |
| 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:48 | dalke | set | spambayes_score: 0.00469426 -> 0.004694262 recipients: + dalke, loewis, arigo, rhettinger, tds333, christian.heimes |
| 2008年01月13日 13:08:48 | dalke | set | spambayes_score: 0.00469426 -> 0.00469426 messageid: <1200229728.71.0.130711771557.issue1367711@psf.upfronthosting.co.za> |
| 2008年01月13日 13:08:47 | dalke | link | issue1367711 messages |
| 2008年01月13日 13:08:46 | dalke | create | |