#117 closed enhancement (fixed)
Let makedirs accept `exist_ok` as argument and fix default behavior
Reported by: | ftputiluser | Owned by: | schwa |
---|---|---|---|
Priority: | major | Milestone: | 4.0.0 |
Component: | Library | Version: | 3.4 |
Keywords: | makedirs, exist_ok | Cc: |
Description
thank you for this library.
to fit the pyhton os module it would be nice if makedirs could accept additional args.
Change History (5)
comment:1 Changed 3 years ago by
comment:2 Changed 3 years ago by
Summary: | let makedirs accept exist_ok=False as argument → Let makedirs accept `exist_ok` as argument and fix default behavior |
---|
comment:3 Changed 9 months ago by
Keywords: | makedirs exist_ok added |
---|---|
Milestone: | → 4.0.0 |
Status: | new → assigned |
Version: | → 3.4 |
comment:4 Changed 8 months ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fixed in [f16e9b5084b3].
comment:5 Changed 7 months ago by
As I meanwhile noticed, the earlier behavior of makedirs
in ftputil wasn't a bug, but the actual semantics of os.makedirs
in Python 2. On the other hand, Python 3 not only adds the argument exist_ok
, but also chooses the default so that the default behavior is different from that in Python 2.
So this issue has to be listed under the backward-incompatible changes in the documentation and in the announcement.
Note: See
TracTickets for help on using
tickets.
Thank you for the report!
I agree,
FTPHost.makedirs
should accept theexist_ok
argument, asos.makedirs
does.When looking at the code, I noticed that the current implementation doesn't accept an
exist_ok
argument, but behaves as ifexist_ok=True
was given. However, according to the documentation at https://docs.python.org/3/library/os.html#os.makedirs ,exist_ok
should beFalse
by default.I plan to change the behavior in a future ftputil 4.0.0, so that
makedirs
withoutexist_ok
conforms to the Python documentation and theexist_ok
argument is supported.