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.mkdir is not working for multiple level of directory creation in windows environment
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: ChandrajyotiDas, SilentGhost
Priority: normal Keywords:

Created on 2016-06-22 08:59 by ChandrajyotiDas, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg269062 - (view) Author: Chandrajyoti (ChandrajyotiDas) Date: 2016-06-22 08:59
Problem:
os.mkdir is not working for multiple level of directory creation in windows environment.

Explanation:
Suppose there is a directory whose path is "D:\Output"

Now to create 2 levels of directory in side the path "D:\Output", when os.mkdir("D:\Output\Dir1\Dir2") is used, python 2.7 throws errors as below:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
WindowsError: [Error 3] The system cannot find the path specified: 'D:\\Output\\Dir1\\Dir2'

Please update python to create multiple level of directory.
msg269064 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2016-06-22 09:03
You need to use os.makedirs
History
Date User Action Args
2022-04-11 14:58:32adminsetgithub: 71555
2016-06-22 09:03:04SilentGhostsetstatus: open -> closed

type: enhancement -> behavior

nosy: + SilentGhost
messages: + msg269064
resolution: not a bug
stage: resolved
2016-06-22 08:59:07ChandrajyotiDascreate