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.

classification
Title: os.makedirs fail if path contains os.pardir
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, nirs
Priority: normal Keywords:

Created on 2005-12-05 02:05 by nirs, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
makedirs_pardir.diff nirs, 2005-12-05 02:08 patch with tests for 2.5.0
Messages (3)
msg26991 - (view) Author: Nir Soffer (nirs) * Date: 2005-12-05 02:05
os.makedirs fail with "OSError: [Errno 17] File exists:" error when trying 
to create paths like 'a/b/../c' or 'a/b/c/..'.

Seen on 2.3.0, 2.4.1 and 2.5.0.

Included patch with new test cases that fail with current 2.5 code. 
msg26992 - (view) Author: Nir Soffer (nirs) * Date: 2005-12-05 02:08
Logged In: YES 
user_id=832344

And here are the tests.
msg26993 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2005-12-17 17:49
Logged In: YES 
user_id=1188172

It's not clear what os.makedirs should do with such
arguments. It should stay simple and not try to correct bad
paths.

I amended the docs to spell that out in rev. 41736/41737.
History
Date User Action Args
2022-04-11 14:56:14adminsetgithub: 42660
2005-12-05 02:05:00nirscreate