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 orsenthil
Recipients alphalfalfa, martin.panter, orsenthil, rhettinger
Date 2016-01-04.02:40:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1451875213.75.0.696612628345.issue25641@psf.upfronthosting.co.za>
In-reply-to
Content
os.environ is never changed by getproxies_environment()

Like Martin Panter, I will curious to know as how the user experienced this issue in the place.

@Raymond Hettinger: If the dict is only read and never modified in the fuction, does it still make sense to have a defensive list() as you suggested? If yes, then there will be couple of places in the stdlib code that will need this change.

```
$ ag os.environ.items Lib
Lib/distutils/_msvccompiler.py
80:            for key, value in os.environ.items()

Lib/test/test_os.py
679:        for key, val in os.environ.items():

Lib/test/test_wsgiref.py
427:    os_environ = dict(os.environ.items())

Lib/urllib/request.py
2453:    for name, value in os.environ.items():

Lib/wsgiref/handlers.py
47:    for k, v in os.environ.items():
```

My understanding is, if the function is not manipulation and only reading the dictionary, a defensive list or copy is not required. And, this bug report should be closed.
History
Date User Action Args
2016-01-04 02:40:13orsenthilsetrecipients: + orsenthil, rhettinger, martin.panter, alphalfalfa
2016-01-04 02:40:13orsenthilsetmessageid: <1451875213.75.0.696612628345.issue25641@psf.upfronthosting.co.za>
2016-01-04 02:40:13orsenthillinkissue25641 messages
2016-01-04 02:40:12orsenthilcreate