[Python-bugs-list] [ python-Bugs-465447 ] os.makedirs can fail with UNC paths

noreply@sourceforge.net noreply@sourceforge.net
Thu, 27 Sep 2001 09:19:45 -0700


Bugs item #465447, was opened at 2001-09-26 17:13
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465447&group_id=5470

Category: Documentation
Group: Platform-specific
Status: Open
Resolution: None
Priority: 5
Submitted By: Andrew Bennetts (spiv)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: os.makedirs can fail with UNC paths

Initial Comment:
Calling 
  os.makedirs('//remote/path/that/does/not/exist/yet')

can cause an "OSError: [Errno 22] Invalid 
argument: '//remote'"

If I map an equivalent network drive, it works fine 
(e.g. os.makedirs('N:/that/does/not/exist/yet'))


----------------------------------------------------------------------

>Comment By: Tim Peters (tim_one)
Date: 2001-09-27 09:19

Message:
Logged In: YES 
user_id=31435

I agree.  Most of these date back to DOS days, before UNC 
paths existed.  The newer ones (like os.makedirs) appear to 
have been written with (only) Unix in mind.

----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-09-27 08:59

Message:
Logged In: YES 
user_id=6380

I find that an unsettling conclusion. Maybe we've built too
much knowledge about DOS paths into our path manipulation
code? It's definitely a feature request, although in the
short run it's OK to update the docs.

----------------------------------------------------------------------

Comment By: Tim Peters (tim_one)
Date: 2001-09-26 20:07

Message:
Logged In: YES 
user_id=31435

It's hard to know whether to call this a doc bug or a 
feature request -- it's something of both.  Calling it a 
doc bug for now and reassigning to Fred.

Lots of things don't work with UNC paths, starting with 
ntpath.split() (the immediate cause of the failure reported 
here).  The only functions we have that understand UNC 
paths are path.splitunc(), and the only one that calls it, 
path.ismount() (which isn't called by anything else).

Until someone contributes code and test cases to make 
everything else UNC-aware, we should document that sundry 
os. and os.path functions don't work with UNC paths 
correctly.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465447&group_id=5470