Author selik
Recipients selik
Date 2020-04-14.03:36:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1586835419.23.0.357197099635.issue40278@roundup.psfhosted.org>
In-reply-to
Content
The pathlib module ``Path.replace(target)`` states that "If target points to an existing file or directory, it will be unconditionally replaced."  However, this does not appear to be true.  I experience an OSError ``[Errno 66] Directory not empty`` when attempting to ``replace`` to an existant target.

https://docs.python.org/3/library/pathlib.html#pathlib.Path.replace


I see that others on StackOverflow encounter the same issue.  The top answer ignores the Python documentation and recommends removing the target directory before replacing.

https://stackoverflow.com/questions/50355180/use-pathlib-to-destructively-rename-one-directory-to-another-existing-directory
History
Date User Action Args
2020-04-14 03:36:59seliksetrecipients: + selik
2020-04-14 03:36:59seliksetmessageid: <1586835419.23.0.357197099635.issue40278@roundup.psfhosted.org>
2020-04-14 03:36:59seliklinkissue40278 messages
2020-04-14 03:36:59selikcreate