Sun, 09 Oct 2016 17:44:23 +0200 py3: add an os.fsencode backport to ease path handling
Martijn Pieters <mjpieters@fb.com> [Sun, 09 Oct 2016 17:44:23 +0200] rev 30119
py3: add an os.fsencode backport to ease path handling
Sun, 09 Oct 2016 14:10:01 +0200 py3: a second argument to open can't be bytes
Martijn Pieters <mjpieters@fb.com> [Sun, 09 Oct 2016 14:10:01 +0200] rev 30118
py3: a second argument to open can't be bytes This fixes open(filename, 'r'), open(filename, 'w'), etc. calls. In Python 3, that second argument *must* be a string, you can't use bytes. The fix is the same as used with getattr() (where the second argument must also always be a string); in the tokenizer, where we detect calls, if there is something that looks like a call to open (and is not an attribute, so the previous token is not a "." dot) then make sure that that second argument is not converted to a `bytes` object instead. There is some remaining issue where the current transformer will also rewrite open(f('foo')). However this also affect function for which we perform similar rewrite ('getattr', 'setattr', 'hasattr', 'safehasattr') and will be dealt with in a follow up.
Sun, 09 Oct 2016 17:02:34 +0200 py3: make check-py3-compat.py import importlib only if necessary
Yuya Nishihara <yuya@tcha.org> [Sun, 09 Oct 2016 17:02:34 +0200] rev 30117
py3: make check-py3-compat.py import importlib only if necessary importlib isn't available on Python 2.6, and it isn't necessary for Py2 checks.
(0) -30000 -10000 -3000 -1000 -300 -100 -30 -10 -3 +3 +10 +30 +100 +300 +1000 +3000 +10000 tip