thank you for this library.
to fit the pyhton os module it would be nice if makedirs could accept additional args.
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.
Fixed in a2843e387f3c3d6e17a8ef2fcf3a25df1006d761.
As I meanwhile noticed, the earlier behavior of
makedirs
in ftputil wasn't a bug, but the actual semantics ofos.makedirs
in Python 2. On the other hand, Python 3 not only adds the argumentexist_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.