Skip to content

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