Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1)

#21539: pathlib's Path.mkdir() should allow for "mkdir -p" functionality

Can't Edit
Can't Publish+Mail
Start Review
Created:
5 years, 10 months ago by jim
Modified:
5 years, 10 months ago
Reviewers:
barry, berker.peksag, pitrou
CC:
barry, AntoinePitrou, devnull_psf.upfronthosting.co.za, berkerpeksag, jim_garrison.cc
Visibility:
Public.

Patch Set 1 #

Total comments: 7

Patch Set 2 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Doc/library/pathlib.rst View 1 1 chunk +10 lines, -1 line 0 comments Download
Lib/pathlib.py View 1 1 chunk +9 lines, -2 lines 0 comments Download
Lib/test/test_pathlib.py View 1 1 chunk +36 lines, -0 lines 0 comments Download

Messages

Total messages: 4
barry
Just a quick look. +1 on the idea. http://bugs.python.org/review/21539/diff/11914/Doc/library/pathlib.rst File Doc/library/pathlib.rst (right): http://bugs.python.org/review/21539/diff/11914/Doc/library/pathlib.rst#newcode801 Doc/library/pathlib.rst:801: If ...
5 years, 10 months ago #1
berkerpeksag
http://bugs.python.org/review/21539/diff/11914/Doc/library/pathlib.rst File Doc/library/pathlib.rst (right): http://bugs.python.org/review/21539/diff/11914/Doc/library/pathlib.rst#newcode801 Doc/library/pathlib.rst:801: If *parents* is ``True``, any missing parents of this ...
5 years, 10 months ago #2
pitrou_free.fr
http://bugs.python.org/review/21539/diff/11914/Lib/pathlib.py File Lib/pathlib.py (right): http://bugs.python.org/review/21539/diff/11914/Lib/pathlib.py#newcode1119 Lib/pathlib.py:1119: if not exist_ok: > since I'm explicitly catching the ...
5 years, 10 months ago #3
berkerpeksag
5 years, 10 months ago #4
http://bugs.python.org/review/21539/diff/11914/Doc/library/pathlib.rst
File Doc/library/pathlib.rst (right):

http://bugs.python.org/review/21539/diff/11914/Doc/library/pathlib.rst#newcod...
Doc/library/pathlib.rst:801: If *parents* is ``True``, any missing parents of
this path are created
On 2014/05/27 20:37:46, barry wrote:
> I don't you need to change the existing language here, since any truthy value
> will work.  Same below for `False`.  OTOH, os.makedirs() uses "True" and
> "False".  Let's at least be consistent within this module (see below).

Done.

http://bugs.python.org/review/21539/diff/11914/Lib/pathlib.py
File Lib/pathlib.py (right):

http://bugs.python.org/review/21539/diff/11914/Lib/pathlib.py#newcode1119
Lib/pathlib.py:1119: if not exist_ok:
On 2014/05/28 11:15:11, AntoinePitrou wrote:
> > since I'm explicitly catching the FileExistsError exception.
> 
> The isdir() test is needed, at least for the last path component:
> 
> >>> os.mkdir("setup.py")
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> FileExistsError: [Errno 17] File exists: 'setup.py'
> 

Done.
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+