|
Even though the python 3.9 documentation for shutil.move [1] states that
"[..] a path-like object for both src and dst" is accepted, it does not
in fact support bytes as arguments. This is because shutil.move calls
_dstinsrc [2] which tries to compare bytes with str via str.endswith.
Python seems to be aware of this [3], but has not yet fixed any of these
problems. For now just decode both bytes objects so shutil.move works.
[1] https://docs.python.org/3.9/library/shutil.html?highlight=shutil%20move#shutil.move
[2] https://github.com/python/cpython/blob/a58ebcc701dd6c43630df941481475ff0f615a81/Lib/shutil.py#L829-L836
[3] https://bugs.python.org/issue46727
|