[issue9097] os.chdir(path) to return current dir

anatoly techtonik report at bugs.python.org
Mon Jun 28 13:43:29 CEST 2010


New submission from anatoly techtonik <techtonik at gmail.com>:

os.chdir(path) is often used with os.getcwd() call and doesn't return anything. It can return the name of the directory before the change.

prev = os.chdir(path)
...
os.chdir(prev)

Maybe it will also be possible to implement 'with' construct:

with os.chdir(path):
  ...

----------
messages: 108822
nosy: techtonik
priority: normal
severity: normal
status: open
title: os.chdir(path) to return current dir
type: feature request

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9097>
_______________________________________


More information about the Python-bugs-list mailing list