Eryk Sun <[email protected]> added the comment:
This issue isn't specific to Windows. It's a bug in shutil._basename:
def _basename(path):
# A basename() variant which first strips the trailing slash, if
present.
# Thus we always get the last component of the path, even for
directories.
sep = os.path.sep + (os.path.altsep or '')
return os.path.basename(path.rstrip(sep))
It should use `os.fspath(path)` to get the path as a string.
----------
components: +Library (Lib) -Windows
keywords: +easy
nosy: +eryksun
stage: -> needs patch
title: Fail to move file in Windows (AttributeError) -> shutil.move fails with
AttributeError
type: -> behavior
versions: +Python 3.6, Python 3.8
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue34069>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com