python3-cephfs focal 'syntax warning' is/literal

Bug #1878939 reported by Harry Coin
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ceph (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

During apt install from an otherwise blank focal/mate:

setting up python3-cephfs (15.2.1-0ubuntu2) ...
/usr/lib/python3/dist-packages/ceph_volume_client.py:358: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  group_id = group_id if group_id is not 'None' else None
/usr/lib/python3/dist-packages/ceph_volume_client.py:381: SyntaxWarning: "is" with a literal. Did you mean "=="?
  readonly = True if access_level is 'r' else False
/usr/lib/python3/dist-packages/ceph_volume_client.py:1102: SyntaxWarning: "is" with a literal. Did you mean "=="?

...
The compiler now produces a SyntaxWarning when identity checks (is and is not) are used with certain types of literals (e.g. strings, numbers). These can often work by accident in CPython, but are not guaranteed by the language spec. The warning advises users to use equality tests (== and !=) instead. (Contributed by Serhiy Storchaka in bpo-34850.)

Revision history for this message
Harry Coin (hcoin) wrote :

Good detail here on why this can go horribly wrong if ignored:
https://adamj.eu/tech/2020/01/21/why-does-python-3-8-syntaxwarning-for-is-literal/

Revision history for this message
Kai Kasurinen (kai-kasurinen) wrote :
Revision history for this message
Rolf Leggewie (r0lf) wrote :

fixed upstream in v15.2.9 (https://docs.ceph.com/en/latest/releases/octopus/#v15-2-9-octopus), so focal-security and later are no longer affected

Changed in ceph (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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