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 vstinner
Recipients brian.curtin, eric.smith, orsenthil, r.david.murray, techtonik, vstinner
Date 2013-06-23.11:36:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1371987373.81.0.369376665711.issue9097@psf.upfronthosting.co.za>
In-reply-to
Content
The idea was discussed many times, and there are existing implementations:

http://mail.python.org/pipermail/python-ideas/2013-January/018756.html
http://www.astropython.org/snippet/2009/10/chdir-context-manager
http://stackoverflow.com/questions/169070/python-how-do-i-write-a-decorator-that-restores-the-cwd
...

The idea was rejected because it is "an anti-pattern" "encouraging a bad habit".

The current working directory is something global, as locales on UNIX: in a multithreaded application, all threads would be affected by such change. It's better to work only with absolute paths and never call os.chdir().
History
Date User Action Args
2013-06-23 11:36:13vstinnersetrecipients: + vstinner, orsenthil, eric.smith, techtonik, r.david.murray, brian.curtin
2013-06-23 11:36:13vstinnersetmessageid: <1371987373.81.0.369376665711.issue9097@psf.upfronthosting.co.za>
2013-06-23 11:36:13vstinnerlinkissue9097 messages
2013-06-23 11:36:13vstinnercreate