Python Doc Error: os.makedirs

Xah Lee xah at
Wed Oct 19 03:30:49 CEST 2005

Python doc problem:

makedirs(  	path[, mode])
    Recursive directory creation function. Like mkdir(), but makes all
intermediate-level directories needed to contain the leaf directory.
Throws an error exception if the leaf directory already exists or
cannot be created. The default mode is 0777 (octal). This function does
not properly handle UNC paths (only relevant on Windows systems;
Universal Naming Convention paths are those that use the `\\host\path'
syntax). New in version 1.5.2.

The “Throws an error exception” should be “Throws an OSError


i think the function shouldn't complain if dir already exists. How is a
programer to distinguish if the dir already exists, or if there's a
problem creating the dir?

 xah at xahlee.org

More information about the Python-list mailing list