python3-chardet breaks install of python-chardet

Bug #1901295 reported by Julien Olivier
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python3-chardet (Ubuntu)
Incomplete
Undecided
Unassigned

Bug Description

I'm trying to install python-chardet (for python-2.7), but it fails because latest python3-chardet breaks python-chardet. I fail to understand why the python3 version of chardet would break the python2.7 version of the same module.

PS: I know that python2.7 is not supported anymore, but I have an application that depends on it, and I need to install it, and that's now impossible because of this bug.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

I can confirm the behavior

Changed in python3-chardet (Ubuntu):
status: New → Confirmed
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Maintainers are free to remove python2 if there are no reverse dependencies left for the obvious unsupportability.
This happened here in [1] to resolve [2]

There also is no installation candidate left in a recent archive. Maybe replaces/breaks was a bit too much (as users like you could be happy to keep the old one around on an upgrade). But I'm unsure about the policy on such cleanups, maybe it was intentional to remove old no more supported bits. If you read the Debian bug I linked that makes sense.

This isn't jsuta n Ubuntu/Debian decision, also all upstream archives/support for 2.x have ended.
I'm unsure what to do here, asking you to get your application that depends on it upgraded?

[1]: https://salsa.debian.org/python-team/packages/chardet/-/commit/5b4be98c3c408e1b73f94f8fb133bb7ceadec81f
[2]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=936289

Revision history for this message
Julien Olivier (julo) wrote :

I analyzed the two packages and I think I found the reason why they break each other: both contain /usr/bin/chardet and /usr/bin/chardetect (as well as the associated man pages).

So, a possible solution could be remove those two binaries, and their man pages from both python-chardet and python3-chardet, and create a new package "chardet" on which both would depend.

Of course, this is just a suggestion, and I'm pretty sure the package maintainer is well aware of the situation and has his own reasons not to split the packages.

Revision history for this message
Julien Olivier (julo) wrote :

PS: just to be clear: what I really mean is that, if python3-chardet was split into a "python3-chardet" (with only the module), and a "chardet" package (with only the binaries / manpage), it would then be possible for a third party to provide a "python-chardet" without the binaries / manpages that would also depend on "chardet". The new "python-chardet" (for python2) would of course not need to be maintained into Debian.

Revision history for this message
Paride Legovini (paride) wrote :

Hi Julien and thanks for filing this bug.

I think your suggestion could work in principle, however I doubt it will be implemented in practice. It would mean modifying a package to support an unsupported package and more in general an unsupported setup.

Splitting the package in Debian would require it to go through the NEW queue again, which can be a quite lengthy process. Moreover Ubuntu would pickup the fixed package only in Hirsute (at best), so your existing systems wouldn't get the fix. Fixing the package directly in Ubuntu isn't a good idea either, as it's currently a sync from Debian, and we tend to avoid adding package deltas when possible, and still the fix could only land in Hirsute.

If you still want to try this way I suggest you to file a bug in Debian and wait for the package maintainers opinion, however the true way forward here is to leave Python2 behind. If that's not an option you can still stick to Bionic for the moment, it's supported until 2028.

I'm setting this bug to Incomplete to leave it open for further discussion if needed, but I think it should be considered a Won't Fix.

Changed in python3-chardet (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Julien Olivier (julo) wrote :

Hi Paride,

I've just reported this bug for the record, and with the ope that it could help other people with the same problem. As to me, I have already found a workaround: my Python2 doesn't really depend on python-chardet, but on python-requests (which itself depends on python-chardet). So i "fixed" it by creating my own "python-requests-with-chardet" package which includes both python-request and python-chardet modules. This way I can install my application without generating a conflict with python3-chardet.

If no proper solution can be found in Debian/Ubuntu, feel free to just close it WONTFIX.

Revision history for this message
Julien Olivier (julo) wrote :

Sorry for the typos: I meant "with the Hope", and "my Python2 application doesn't really depend on python-chardet".

Revision history for this message
Adham Amiin (aminadharipper) wrote :

sudo apt install --reinstall python3-debian python3-chardet
Will work just fine ;)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.