code confuses identity and equality (fixed upstream)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Debian |
Fix Released
|
Unknown
|
|||
ansible (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
python-jmespath (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned | ||
python-netaddr (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
IMPACT:
Python 3.8 has started to emit warnings for code that confuses equality and identity. For more background see https:/
While it is just a warning, it is very visible when running ansible on focal for example, to the point of making the output incredibly hard to follow. Furthermore, the indifference between identity and equality might be creating true bugs as discussed in above blog entry. It seems advisable to fix this incorrect code when found.
TEST CASE:
tbd
REGRESSION POTENTIAL:
The current code checks for identity via "is" and and "is not"...
Original report below:
=======
lsb_release -rd
Description: Ubuntu 20.04.2 LTS
Release: 20.04
apt-cache policy ansible
ansible:
Installed: 2.9.6+dfsg-1
Candidate: 2.9.6+dfsg-1
Version table:
*** 2.9.6+dfsg-1 500
500 http://
500 http://
100 /var/lib/
Hi, I install ansible have output some log:
Selecting previously unselected package python3-markupsafe.
(Reading database ... 194136 files and directories currently installed.)
Preparing to unpack .../00-
Unpacking python3-markupsafe (1.1.0-1build2) ...
Selecting previously unselected package python3-jinja2.
Preparing to unpack .../01-
Unpacking python3-jinja2 (2.10.1-2) ...
Selecting previously unselected package python3-dnspython.
Preparing to unpack .../02-
Unpacking python3-dnspython (1.16.0-1build1) ...
Selecting previously unselected package ieee-data.
Preparing to unpack .../03-
Unpacking ieee-data (20180805.1) ...
Selecting previously unselected package python3-netaddr.
Preparing to unpack .../04-
Unpacking python3-netaddr (0.7.19-3) ...
Selecting previously unselected package ansible.
Preparing to unpack .../05-
Unpacking ansible (2.9.6+dfsg-1) ...
Selecting previously unselected package python3-
Preparing to unpack .../06-
Unpacking python3-argcomplete (1.8.1-1.3ubuntu1) ...
Selecting previously unselected package python3-jmespath.
Preparing to unpack .../07-
Unpacking python3-jmespath (0.9.4-2) ...
Selecting previously unselected package python3-kerberos.
Preparing to unpack .../08-
Unpacking python3-kerberos (1.1.14-3.1build1) ...
Selecting previously unselected package python3-lockfile.
Preparing to unpack .../09-
Unpacking python3-lockfile (1:0.12.2-2ubuntu2) ...
Selecting previously unselected package python3-libcloud.
Preparing to unpack .../10-
Unpacking python3-libcloud (2.8.0-1) ...
Selecting previously unselected package python3-ntlm-auth.
Preparing to unpack .../11-
Unpacking python3-ntlm-auth (1.1.0-1) ...
Selecting previously unselected package python3-
Preparing to unpack .../12-
Unpacking python3-
Selecting previously unselected package python3-
Preparing to unpack .../13-
Unpacking python3-
Selecting previously unselected package python3-selinux.
Preparing to unpack .../14-
Unpacking python3-selinux (3.0-1build2) ...
Selecting previously unselected package python3-xmltodict.
Preparing to unpack .../15-
Unpacking python3-xmltodict (0.12.0-1) ...
Selecting previously unselected package python3-winrm.
Preparing to unpack .../16-
Unpacking python3-winrm (0.3.0-2) ...
Setting up python3-lockfile (1:0.12.2-2ubuntu2) ...
Setting up python3-ntlm-auth (1.1.0-1) ...
Setting up python3-kerberos (1.1.14-3.1build1) ...
Setting up python3-libcloud (2.8.0-1) ...
Setting up python3-markupsafe (1.1.0-1build2) ...
Setting up python3-xmltodict (0.12.0-1) ...
Setting up python3-jinja2 (2.10.1-2) ...
Setting up python3-jmespath (0.9.4-2) ...
/usr/lib/
if x is 0 or x is 1:
/usr/lib/
if x is 0 or x is 1:
/usr/lib/
elif y is 0 or y is 1:
/usr/lib/
elif y is 0 or y is 1:
/usr/lib/
if original_result is 0:
Setting up python3-
Setting up ieee-data (20180805.1) ...
Setting up python3-dnspython (1.16.0-1build1) ...
Setting up python3-selinux (3.0-1build2) ...
Setting up python3-argcomplete (1.8.1-1.3ubuntu1) ...
Setting up python3-
Setting up python3-netaddr (0.7.19-3) ...
/usr/lib/
if word_sep is not '':
Setting up python3-winrm (0.3.0-2) ...
Setting up ansible (2.9.6+dfsg-1) ...
Processing triggers for man-db (2.9.1-1) ...
Changed in ansible (Ubuntu): | |
status: | New → Invalid |
description: | updated |
Changed in debian: | |
status: | Unknown → Fix Released |
description: | updated |
description: | updated |
This is indeed a bug. Thank you for reporting. More info at https:/ /adamj. eu/tech/ 2020/01/ 21/why- does-python- 3-8-syntaxwarni ng-for- is-literal/