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.

Author Dan Buchoff
Recipients Dan Buchoff, paul.moore, steve.dower, tim.golden, zach.ware
Date 2017-02-01.22:46:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1485989192.98.0.740495069051.issue29416@psf.upfronthosting.co.za>
In-reply-to
Content
If a path has a non-existent anchor, Path.mkdir can get into a RecursionError as it tries to recursively create the parent. I expect a more sane error.

This is readily reproducible in Windows with `Path('Z:').mkdir(parents=True)`

Example execution:

Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from pathlib import Path
>>> Path('Z:').mkdir(parents=True)
Traceback (most recent call last):
  File "C:\Python36\lib\pathlib.py", line 1231, in mkdir
    self._accessor.mkdir(self, mode)
  File "C:\Python36\lib\pathlib.py", line 388, in wrapped
    return strfunc(str(pathobj), *args)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'Z:'

During handling of the above exception, another exception occurred:

...

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python36\lib\pathlib.py", line 1238, in mkdir
    self.parent.mkdir(parents=True)
  File "C:\Python36\lib\pathlib.py", line 1238, in mkdir
    self.parent.mkdir(parents=True)
  File "C:\Python36\lib\pathlib.py", line 1238, in mkdir
    self.parent.mkdir(parents=True)
  [Previous line repeated 989 more times]
  File "C:\Python36\lib\pathlib.py", line 1231, in mkdir
    self._accessor.mkdir(self, mode)
  File "C:\Python36\lib\pathlib.py", line 388, in wrapped
    return strfunc(str(pathobj), *args)
RecursionError: maximum recursion depth exceeded
History
Date User Action Args
2017-02-01 22:46:33Dan Buchoffsetrecipients: + Dan Buchoff, paul.moore, tim.golden, zach.ware, steve.dower
2017-02-01 22:46:32Dan Buchoffsetmessageid: <1485989192.98.0.740495069051.issue29416@psf.upfronthosting.co.za>
2017-02-01 22:46:32Dan Buchofflinkissue29416 messages
2017-02-01 22:46:32Dan Buchoffcreate