Skip to content

Update moveall for python3 compatibility #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ilohmar
Copy link

@ilohmar ilohmar commented Dec 8, 2019

This should, as far as I can see, not hamper python2 compatibility. But
Python2 is no longer supported starting from 2020-01-01, anyway...

Changes:

  • iteritems -> items
  • print statement -> function call
  • proper handling of local exception var
  • use util.py3_path on internal bytes paths where necessary

shutil.move must not be called w/ bytes paths, as it calls
path.rstrip(sep) on a passed path, where sep is a string.

Apparently, beets calls the event handlers with (discouraged, but
internally-used) bytes "paths" instead of unicode strings, presumably a
python2 legacy.

- iteritems -> items
- print statement -> function call
- proper handling of local exception var
- use util.py3_path on internal bytes paths where necessary

shutil.move must not be called w/ bytes paths, as it calls
path.rstrip(sep) on a passed path, where sep is a string.

Apparently, beets calls the event handlers with (discouraged, but
internally-used) bytes "paths" instead of unicode strings, presumably a
python2 legacy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant