-
Notifications
You must be signed in to change notification settings - Fork 220
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
Consider dropping Python 2 support #435
Comments
Since many of the libraries that we rely on will soon be dropping their Python 2 support, I'm generally in favour of also dropping the Python 2 support for In the past I've had to deal with environments where I could only easily run Python 2, since running Python 3 would have required that I cross compile it myself and somehow get it to permanently reside in the memory of those rather special systems, so there are certain use cases I see for which it would be good to keep Python 2 support. But the only realistic option to keep the Python 2 support would be to pin the latest Python 2 supporting versions of all our dependencies, which is pretty bad from a security point of view. Therefore it is most likely the best option to just drop the Python 2 support. I don't see any reason to do so right away, but as soon as the first major dependency drops the support, we pretty much also have to do so. Maybe we should prepare for that time by stating in all important places, that the Python 2 support will be dropped to give the users time to prepare (and try to find out the rough time when this will take place). |
urllib3, upstream dependency of requests, has dropped Python 2 support, though this isn't released yet: urllib3/urllib3#2044 |
They additionally dropped the Python 3.5 support in that pull request, which we should also watch. |
👍 Next week it is 700 days since Python 2 went EOL. Let's cut a final release that supports legacy Python and then move forward. |
Ok. Thanks to everyone for pushing on this, and thanks for your patience. It's been a long time coming! I think it's time, let's start talking about what a final PY2 release would look like (any outstanding bugs in PY2 we should try and deal with before shipping the last PY2 version, etc.), and go from there. Thanks again! |
Some thoughts in no particular order:
So overall, I can't really think of any particular significant things that should be fixed for a final Py2-compatible release. However, I also never used ia on Py2 myself, so I may be missing something. |
Considering the above and the recent release of version 2.3.0, can we drop Py2 yet? :-) |
@JustAnotherArchivist Yeah, I think we should move ahead with dropping PY2 support! Thanks for taking the time to consider all of the above, and following up on it. |
Yay! I'll work on a PR to remove the cruft. |
In addition to the obvious changes, this also includes the following noteworthy ones: - `ia list` had a bug on Python 3, introduced by f52ff26, where it behaved differently for list-like file metadata on Py2 than Py3. This ports the Py2 behaviour to Py3. - `internetarchive.utils.map2x` is gone. This was unused since 4f05beb, only needed for Py2 compatibility, and never part of the public API. - The `pex-requirements.txt` file didn't match the dependencies in `setup.py` anymore; synchronised those again. Closes jjjake#435
It's been almost two years since Python 2 has reached end-of-life. Some things already broke, and this will only get worse over time. Also, the code is significantly more complex (everything involving six; see also my struggles on #405).
I suggest dropping Python 2 support and removing the accompanying code cruft.
@jjjake has previously said in #405 that he 'would like to support [Python 2] as long as we're able to'. As such, I don't expect this to be acted on immediately. But I think it is inevitable as dependencies have begun to drop Py2 support, slowly making it harder to keep the support here.
Relevant issues so far (in no particular order):
ItemLocate
error causes crash under Python 2: ItemLocateError broken on Python 2 #385ia tasks
on Python 2 can't work reliably (without API changes) due to the lack of appropriate decoding error handlers: UnicodeDecodeError when trying to display task logs with invalid UTF-8 #359 and Fix crash inia tasks
when a task log contains invalid UTF-8 #360As of right now, the contextlib2 development breaks new ia installations entirely on Python 2 unless you manually install an older version of that package. It could be pinned, but that's just delaying the inevitable.
Further things to look forward to:
The text was updated successfully, but these errors were encountered: