[Python-ideas] chdir context manager (original) (raw)

Steve Dower Steve.Dower at microsoft.com
Mon Jan 21 17:50:12 CET 2013


FWIW, when Windows revised their API set, GetCurrentDirectory and SetCurrentDirectory were completely removed. This seems a pretty strong move away from these APIs. (This only applies to new-style Windows 8 apps; desktop apps can still call them, but the intent is clear.)

Cheers, Steve

-----Original Message----- From: Python-ideas [mailto:python-ideas-_ _bounces+steve.dower=microsoft.com at python.org] On Behalf Of Barry Warsaw Sent: Sunday, January 20, 2013 1238 To: python-ideas at python.org Subject: Re: [Python-ideas] chdir context manager

On Jan 19, 2013, at 04:33 PM, Christian Heimes wrote: >chdir() is not a safe operation because if affects the whole process. >You can NOT make it work properly and safe in a multi-threaded >environment or from code like signal handlers. I've used a homebrewed chdir() context manager but only in certain limited and specific test cases. It's easy enough to write so it doesn't bother me that once in a while I have to. -Barry



More information about the Python-ideas mailing list