Change by Karthikeyan Singaravelan :
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> shutil.move raises AttributeError if first argument is a
pathlib.Path object and destination is a directory
___
Python track
Karthikeyan Singaravelan added the comment:
This is a duplicate of https://bugs.python.org/issue32689 that is fixed in 3.9
. Using os.fspath on path object is more correct here instead of str so that
objects with both __str__ and __fspath__ implemented are handled properly.
--
nosy:
New submission from Luca Paganin :
Suppose you have two pathlib objects representing source and destination of a
move:
src=pathlib.Path("foo/bar/barbar/myfile.txt")
dst=pathlib.Path("foodst/bardst/")
If you try to do the following
shutil.move(src, dst)
Then an AttributeError will be raised,