mirror of
https://github.com/google/brotli.git
synced 2026-07-08 17:56:58 +00:00
Brotli 1.1.0 breaks Python 2 compatibility #477
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @nonatomiclabs on GitHub (Sep 8, 2023).
The latest release of Brotli breaks compatibility with Python 2, due to using
f-strings in thesetup.py:I'm not sure of the correct way to solve the issue:
f-strings fixes the issue and that the package can then be installed with Python 2.python_requiresfield was used to specify that the package needs at least Python 3.6+.@Vangelis66 commented on GitHub (Sep 17, 2023):
... The same underlying root cause (no support for
f-strings) also breaks compatibility with py3.4:PyPI, on the
Brotli-1.1.0page, advertises:For those not fluent in Python 😉 , what was the exact code you used in lieu of L30+L44 of current
setup.py? FWIW,f-stringsinsidesetup.pywere first introduced in27a9a80992...Thanks 😄
@rouilj commented on GitHub (Sep 18, 2023):
Can you try:
and see if that works. If so the other rf line can be similarly munged by:
rf'withr'{variable}in the r string with %s and add% varnameas above.If there is more than 1 variable in the r string, use
% ( var1, var2, ...)matching the varX and the%stokens 1 for 1.
@JacobChrist commented on GitHub (Sep 30, 2023):
This is affecting me too, how can I help? I'm trying to install in Python 2.7.18 venv on a rPi. I can successfully install version 1.0.9
pip install brotli==1.0.9@Yb2S3Man commented on GitHub (Feb 19, 2025):
I highly recommend to release a new version to fix this issue. So far as I know, many script are still in the python2 version and when they have dependency with Brotli, that was not version 1.1.0 but some older version. However, when someone others who're maintaining those scripts nowadays, the Brotli's dependency is version 1.1.0, that's not a feasible solution for users.