-
Couldn't load subscription status.
- Fork 1.9k
Python3
jtpavlock edited this page Jul 21, 2020
·
54 revisions
As of version 1.4, beets supports both Python 3.x and 2.x. Sometime soon, we'll drop support for 2.x.
- calls to
map()should be wrapped inlist()when a list is expected as it returns aniterin python 3
- remove
u'(andu") prefixes from code - remove
u'(andu") prefixes from documentation - remove
u'(andu") prefixes from wiki - delete https://github.com/beetbox/beets/wiki/String-literals page
- run 2to3 to make sure we got everything
- audit all calls to open() (or any other I/O) to see if we can read/write them as text vs binary
- remove any PY2/3 version checks and the related code
- search for all comments with Python 2,Python 3,Python2,Python3,PY2,PY3
- remove py2 specific tests and packages in .travis.yml
- remove any usage of six
- remove
# -*- coding: utf-8 -*-from all python files - replace buffer with memoryview
- replace
codecs.open,io.openwithopen - use explicit keyword arg names in function definitions - PY2:
def foo(.., **kwargs)-> PY3:def foo(.., arg1=None, arg2=None, ...)as per https://docs.python.org/3.3/tutorial/controlflow.html#arbitrary-argument-lists - use
str.formatstyle ({}) inbeets.loggeror drop it completely https://docs.python.org/3/whatsnew/3.2.html#logging - Remove
F405from flake8ignoreconfigurtion ifbeets.loggingis replaced - change
flake8-codingconfiguration tono-accept-encodings - use more 3.x only functions from shutil to replace some of the functions in
beets.utilhttps://docs.python.org/3.4/library/shutil.html (TODO: be more specific) - drop
mockdep since it's part of the stdlib (py >= 3.3) - remove
enum34dep since it's part of the stdlib ( >= 3.4) - Remove unnecessary traceback passing in
HumanReadableException - integrate various suggestions from https://eev.ee/blog/2016/07/31/python-faq-why-should-i-use-python-3/
- Switch windows CI to using github actions https://github.com/beetbox/beets/pull/3678