Python Doc Error: os.makedirs

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


Python doc problem:

http://python.org/doc/2.4.2/lib/os-file-dir.html

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
exception”.

--------

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
 xah at xahlee.orghttp://xahlee.org/




More information about the Python-list mailing list