On 08Nov2014 17:46, Ionel Cristian Mărieș <cont...@ionelmc.ro> wrote:
#2. A context manager for changing working directory (that switches to the
old cwd on exit). Eg:

with path.cd():
assert os.getcwd() == path

As elsewhere remarked, the current working directory is process global state. Changing it can easily have unwanted (and invisible until breakage becomes glaring) side effects.

-1 on this element from me I'm afraid.

Cheers,
Cameron Simpson <c...@zip.com.au>

I couldn't think of anything else to do with it, so I put it on the web.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to