Fix up a variety of Python version issues.
Review Request #9880 — Created April 19, 2018 and submitted
This change updates our Python version requirements, enabling 3.5+,
getting rid of 2.6, and removing a bunch of workarounds for old
versions.Based on work by Joshua Olson at https://reviews.reviewboard.org/r/9652/
- Ran unit tests on Python 2.7 and 3.6.
- Posted some changes.
Description | From | Last Updated |
---|---|---|
E202 whitespace before ')' |
reviewbot | |
I just checked Python 2.7.14. This behavior has not changed. #!/usr/bin/env pythopn print raw_input('test: ') (Note that raw_input is what … |
chipx86 | |
These were issues on modern Python 2.7. The problem was with macOS, not a bug in Python. It does look … |
chipx86 | |
E501 line too long (81 > 79 characters) |
reviewbot | |
We should handle any normalization required in get_input(), instead of passing str() here, just to ensure consistency and prevent workarounds … |
chipx86 |
- Commit:
-
91a66ba0feb4616ac7f05673940e8944ef1661b287ebdb2f0c606d040f24cba157b4873265d4e890
Checks run (2 succeeded)
-
-
I just checked Python 2.7.14. This behavior has not changed.
#!/usr/bin/env pythopn print raw_input('test: ')
(Note that
raw_input
is what theinput
fromsix
maps to on Python 2.x.)$ python test.py > py.log hi $ cat py.log test: hi $ python test.py 2> py.log hi hi $ cat py.log test:
The original bug was saying that the user doesn't get a prompt if redirecting to stdout (due to using the equivalent of
rbt diff
). That bug is still present with modern Python.The real problem here is that the comment is bad. The right solution is probably to have a wrapper function so we aren't working around this in multiple locations.
-
These were issues on modern Python 2.7. The problem was with macOS, not a bug in Python.
It does look like it's fixed as of macOS 10.12.6, according to the bug report. I wonder if we want to keep this and do a version check along with the "darwin" check.
- Commit:
-
f560e22b0be07f8348795f50830a45b01f55db97815aff5efc417b10776f0906ea08c0ec2557d1b5