aboutsummaryrefslogtreecommitdiffstats
path: root/beetsplug/extras.py (unfollow)
Commit message (Collapse)AuthorLines
2024-09-16lint: Format code with BlackWolfgang Müller-5/+7
2022-02-28extras: Decode paths before handing them to shutil.move0.1.0Wolfgang Müller-1/+3
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
2022-02-28extras: Use shutil.move instead of os.renameWolfgang Müller-1/+1
os.rename fails when moving files between devices or filesystems. Instead use shutil.move which uses os.rename or falls back to copying the files and removing the originals.
2022-02-22extras: Specify full list of argumentsWolfgang Müller-2/+2