Senthil Kumaran added the comment:

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.

----------
nosy: +orsenthil
status: open -> pending

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25641>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to