question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Discussion] Drop support for Python 2 and jython?

See original GitHub issue

As was noticed already, the test suite experiences intermittent failures when testing under Jython, because pip fails to install nose. Using the -vv option reveals this:

Could not fetch URL https://pypi.python.org/simple/nose/: 403 Client Error: [[[!!! BREAKING CHANGE !!!]]] Support for clients that do not support Server Name Indication is temporarily disabled and will be permanently deprecated soon. See https://status.python.org/incidents/hzmjhqsdjqgb and https://github.com/pypa/pypi-support/issues/978 [[[!!! END BREAKING CHANGE !!!]]] for url: https://pypi.python.org/simple/nose/ - skipping

This means this breakage is intentional, and the test suite is soon going to break completely.

Jython hasn’t had a release for more than a year, and the https://github.com/jython/jython/ repository has not had any commits for 9 months. SNI support in Jython’s TLS implementation was first requested in 2015, and apparently hasn’t been ever worked on. Let’s face it, Jython is obsolete. And so is Python 2.6, which doesn’t support SNI either, and yet this project still nominally claims to maintain compatibility with it (although it’s not actually included in the test suite, so it might have been broken already).

This might be as good an occasion as any to drop support for Python 2 completely. Doing so would enable us to take advantage of innovations brought by Python 3, like:

  • more granular function signatures (I already had to put a pretty nasty hack in a pull request for the sake of Python 2 support)
  • pathlib (to replace fragile pathname manipulation code)
  • dataclasses (as a replacement for passing fixed-key dicts around)
  • type annotations (a type checker could be added to catch bugs in extractors earlier)
  • native asynchronous programming (might be useful for parallel downloads)
  • __init_subclass__ (to simplify the giant list of imports in extractors.py and plugin loading)
  • html.parser (to replace all the shoddy regex scraping)

Alternatively, the test suite failures could be worked around by manually downloading the packages. (Like upstream already did.) But that would be just delaying the inevitable. Let’s put those zombies in the grave.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:11
  • Comments:20 (14 by maintainers)

github_iconTop GitHub Comments

9reactions
Ashish0804commented, Apr 24, 2021

I agree with OP, there’s no point in maintaining py2 support, the language itself isn’t supported anymore. As of being more welcoming to new users, imo anyone who knows how to install python 2, can already install python 3. All tutorials online tell you to install python3. As of youtube-dl, imo this project has changed a lot from youtube-dl, i don’t see why maintain py2 support just bcoz ytdl does so.

I might have missed something so if anyone is using py2, please lemme know how you are using yt-dlp.

6reactions
pukkandancommented, Sep 17, 2021

Now yt-dlp is not just a fork, it has become the new youtube-dl.

Just because youtube-dl devs have gone missing, you cannot expect me to start doing things the way youtube-dl has done them. Whether you want to see yt-dlp as just a fork with some nifty new features or as the “new youtube-dl” is up to you.

The fact is that we have already removed support for python 3.5 (which is past EOL btw) and support for it is not going to be added back. If anyone wants to, they are always free to fork yt-dlp and work on just the compatibility code. But I am unwilling to bear that overhead

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issue 2694: Jython to python version mapping
Jython is an implementaion of python. Is there any way to find the version of python that is being supported by a particular...
Read more >
Jython FAQ
Jython FAQ · 4.1 What parts of the Python library are supported? · 4.2 Can I use the python DB API from Jython?...
Read more >
Reference Material for Python 2.2 - Jython
This article explains the new features in Python 2.2.2, released on October 14, ... First, __getattr__(attr_name)() is still supported by new-style classes, ...
Read more >
Jython 3 Features and MVP
Jython 3 Features and a Viable Minimum. This is a discussion document that attempts to describe, and to some extent prioritise, features for...
Read more >
Jython 3 Roadmap
This discussion document attempts to outline the steps to Jython 3, ... a higher proportion of modules in Python vs Java, than is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found