Skip to content
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

Drop Python 3.4 support #226

Open
tiptenbrink opened this issue Nov 9, 2021 · 4 comments
Open

Drop Python 3.4 support #226

tiptenbrink opened this issue Nov 9, 2021 · 4 comments

Comments

@tiptenbrink
Copy link

Hi, it is nearly impossible nowadays to install Python 3.4 as it requires openssl1.0, which is very difficult (if not impossible, all solutions from previous years seem to have stopped working) to install as it has been replaced by openssl1.1. Python 3.4 is also EOL for quite some time now. Maybe it is time to remove support?

@avylove
Copy link
Collaborator

avylove commented Nov 13, 2021

Download counts for the last 45 days

python_version download_count
3.7 815,720
3.8 382,366
3.6 186,227
3.9 88,979
3.10 25,073
2.7 22,184
3.5 11,901
3.4 436
3.11 9
Total 1,532,895

Chances are good a lot of those 436 downloads are test runs. I wish that number was lower, but I don't have a problem dropping 3.4. That said, it's not a priority because it's not breaking anything and both @jquast and I are pretty busy these days. I had been thinking I'd deal with it when we can't test it or it blocks something.

Taking a quick look at the code there is a little exception cleanup we can do in Terminal.kbhit(), but it's not a performance hit for other versions. That would be the only code change that's 3.4 specific. Otherwise it's just metadata.

Not specific to 3.4, but related to versions, we can clean up some old version references in the docs and the version check in __init__.py

Also related, we have some cases where we use hasattr() on the standard library but don't have a comment for why. We should probably add comments. That said, they seem to be *nix/windows differences or for redirected streams and not version specific.

@tiptenbrink
Copy link
Author

A main problem is that since 3.4 is so difficult to install (which is probably why it's so much lower than the other versions), it's hard to run a full test suite on blessed on your own machine, which is why I just didn't bother.

@jquast
Copy link
Owner

jquast commented Jun 26, 2024

I don't bother to run tests with older python versions locally, either, I just (ab)use CI to do it on my behalf. We will certainly drop older versions when the download numbers are very low and/or we can't support it in CI.

@avylove
Copy link
Collaborator

avylove commented Jun 26, 2024

Dropped 3.4 in ffc9013
3 downloads for 3.4 in the last month.

However, it doesn't take out the code I mentioned above. We can probably drop it though since 2.7 doesn't have InterruptedError and 3.5+ doesn't raise it.

blessed/blessed/terminal.py

Lines 1293 to 1314 in 167c34e

except InterruptedError:
# Beginning with python3.5, IntrruptError is no longer thrown
# https://www.python.org/dev/peps/pep-0475/
#
# For previous versions of python, we take special care to
# retry select on InterruptedError exception, namely to handle
# a custom SIGWINCH handler. When installed, it would cause
# select() to be interrupted with errno 4 (EAGAIN).
#
# Just as in python3.5, it is ignored, and a new timeout value
# is derived from the previous unless timeout becomes negative.
# because the signal handler has blocked beyond timeout, then
# False is returned. Otherwise, when timeout is None, we
# continue to block indefinitely (default).
if timeout is not None:
# subtract time already elapsed,
timeout -= time.time() - stime
if timeout > 0:
continue
# no time remains after handling exception (rare)
ready_r = [] # pragma: no cover
break # pragma: no cover

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

No branches or pull requests

3 participants