/usr/lib/python3/dist-packages/genshi/filters/i18n.py:352: SyntaxWarning: "is not" with a literal. Did you mean "!="?
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
genshi (Ubuntu) |
Fix Released
|
Low
|
Unassigned | ||
Focal |
Fix Released
|
Low
|
Michał Małoszewski |
Bug Description
[Impact]
The deprecation message shown in below example by the bug reporter isn't helpful to anyone since the user isn’t in a position to update the version of the library being used. It may discourage the user from working with that package. We deprecate lots of things in between releases anyway, so the accidental early warning for just one random item isn’t particularly useful. And developers might be misled into thinking that these deprecations apply to their code and not to the distro-shipped libraries. Finally, it’s just a bad look. Anyway it is worth the candle to fix it, because it should be straightforward and low risk. There is only need to replace the literal “is not” with “!=”. It looks non-professional.
Backport upstream fix to Focal
[Test Plan]
** Reproduction **
Message:
Unpacking python3-genshi (0.7.3-0ubuntu3) ...
Setting up python3-genshi (0.7.3-0ubuntu3) ...
/usr/lib/
assert numeral is not '', "at least pass the numeral param"
Make a container for testing:
First option:
$ lxc launch images:ubuntu/jammy jammy-test
$ lxc shell jammy-test
Then type in:
$ apt install python3-genshi
You shouldn’t notice neither warning nor error message.
Second one attempt:
$ lxc launch images:ubuntu/foca focal-test
$ lxc shell focal-test
Then type in:
$ apt install python3-genshi
Now you will notice the warning message unless fixed.
** Verification **
Follow the reproduction steps above to ensure that the warning messages no longer appear.
[Where problems could occur]
Any code change might change the behavior of the package in a specific situation and cause other errors - but that particular change is small and looks safe in that regard.
It is only an Assert and functionally equivalent, so we expect no change in behavior. The new syntax is supported way back in time and there should be no python version out there not able to work with the new code.
The old issue was only a warning, so fixing it does not change functional behavior (e.g. return codes or results) except getting rid of the warning message
--- original report ---
$ sudo apt install python3-genshi
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
doc-base python-genshi-doc
The following NEW packages will be installed:
python3-genshi
0 upgraded, 1 newly installed, 0 to remove and 44 not upgraded.
Need to get 121 kB of archives.
After this operation, 914 kB of additional disk space will be used.
Get:1 http://
Fetched 121 kB in 0s (3,179 kB/s)
Selecting previously unselected package python3-genshi.
(Reading database ... 229776 files and directories currently installed.)
Preparing to unpack .../python3-
Unpacking python3-genshi (0.7.3-0ubuntu3) ...
Setting up python3-genshi (0.7.3-0ubuntu3) ...
/usr/lib/
assert numeral is not '', "at least pass the numeral param"
Thanks
ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: python3-genshi 0.7.3-0ubuntu3
ProcVersionSign
Uname: Linux 5.4.0-71-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.11-
Architecture: amd64
CasperMD5CheckR
Date: Tue Jun 8 01:16:44 2021
Dependencies:
PackageArchitec
ProcEnviron:
TERM=rxvt-
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: genshi
UpgradeStatus: Upgraded to focal on 2020-01-24 (500 days ago)
Changed in genshi (Ubuntu): | |
status: | New → Triaged |
importance: | Undecided → Low |
tags: | added: bitesize |
Changed in genshi (Ubuntu Focal): | |
assignee: | nobody → Michał Małoszewski (michal-maloszewski99) |
Changed in genshi (Ubuntu Focal): | |
status: | Triaged → In Progress |
description: | updated |
Thank you for the bug report. I confirm the warning during the installation of the package on Focal (Impish is not affected). Given that this is a relatively harmless warning, and that using "is not" in this particular case still renders the correct result, I'm setting this bug's priority as Low.