[Bug 1877792] Re: jmespath SyntaxWarning: "is" with a literal.
** Also affects: python-netaddr (Ubuntu) Importance: Undecided Status: New ** Changed in: python-netaddr (Ubuntu Focal) Status: New => In Progress ** Changed in: python-netaddr (Ubuntu Focal) Assignee: (unassigned) => Eric Desrochers (slashd) ** Changed in: python-netaddr (Ubuntu Bionic) Status: New => In Progress ** Changed in: python-netaddr (Ubuntu Bionic) Assignee: (unassigned) => Eric Desrochers (slashd) ** Summary changed: - jmespath SyntaxWarning: "is" with a literal. + jmespath/netaddr SyntaxWarning: "is" with a literal when installing ansible. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1877792 Title: jmespath/netaddr SyntaxWarning: "is" with a literal when installing ansible. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ansible/+bug/1877792/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1877792] Re: jmespath SyntaxWarning: "is" with a literal.
I have just re-test in a focal lxd container, the installation worked. ii python3-jmespath 0.9.4-2 all JSON Matching Expressions (Python 3) but could mislead the user that it wasn't successfully installed: Setting up python3-jmespath (0.9.4-2) ... /usr/lib/python3/dist-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="? if x is 0 or x is 1: /usr/lib/python3/dist-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="? if x is 0 or x is 1: /usr/lib/python3/dist-packages/jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="? elif y is 0 or y is 1: /usr/lib/python3/dist-packages/jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="? elif y is 0 or y is 1: /usr/lib/python3/dist-packages/jmespath/visitor.py:260: SyntaxWarning: "is" with a literal. Did you mean "=="? if original_result is 0: Setting up python3-requests-kerberos (0.12.0-2) ... Setting up ieee-data (20180805.1) ... Setting up python3-dnspython (1.16.0-1build1) ... Setting up python3-selinux (3.0-1build2) ... Setting up python3-crypto (2.6.1-13ubuntu2) ... Setting up python3-argcomplete (1.8.1-1.3ubuntu1) ... Setting up python3-requests-ntlm (1.1.0-1) ... Setting up python3-libcloud (2.8.0-1) ... Setting up python3-netaddr (0.7.19-3) ... /usr/lib/python3/dist-packages/netaddr/strategy/__init__.py:189: SyntaxWarning: "is not" with a literal. Did you mean "!="? 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) ... -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1877792 Title: jmespath SyntaxWarning: "is" with a literal. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ansible/+bug/1877792/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1877792] Re: jmespath SyntaxWarning: "is" with a literal.
One of the impact is: https://github.com/jmespath/jmespath.py/issues/201 ** Bug watch added: github.com/jmespath/jmespath.py/issues #201 https://github.com/jmespath/jmespath.py/issues/201 -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1877792 Title: jmespath SyntaxWarning: "is" with a literal. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ansible/+bug/1877792/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1877792] Re: jmespath SyntaxWarning: "is" with a literal.
While reviewing this SRU I'm trying to measure the severity of the current situation. Since this seems to be a warning, does it actually impact users in any way besides printing the warning? Are there any consequences of it? Are any of the reverse-dependencies impacted, requiring this fix? -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1877792 Title: jmespath SyntaxWarning: "is" with a literal. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ansible/+bug/1877792/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1877792] Re: jmespath SyntaxWarning: "is" with a literal.
Focal debdiff ** Patch added: "Focal debdiff" https://bugs.launchpad.net/ubuntu/+source/python-jmespath/+bug/1877792/+attachment/5531626/+files/f.debdiff -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1877792 Title: jmespath SyntaxWarning: "is" with a literal. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ansible/+bug/1877792/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1877792] Re: jmespath SyntaxWarning: "is" with a literal.
Bionic debdiff ** Patch added: "Bionic debdiff" https://bugs.launchpad.net/ubuntu/+source/python-jmespath/+bug/1877792/+attachment/5531623/+files/b.debdiff -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1877792 Title: jmespath SyntaxWarning: "is" with a literal. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ansible/+bug/1877792/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1877792] Re: jmespath SyntaxWarning: "is" with a literal.
** Changed in: python-jmespath (Ubuntu Focal) Status: Confirmed => In Progress ** Changed in: python-jmespath (Ubuntu Focal) Assignee: (unassigned) => Eric Desrochers (slashd) ** Changed in: python-jmespath (Ubuntu Bionic) Status: Confirmed => In Progress ** Changed in: python-jmespath (Ubuntu Bionic) Assignee: (unassigned) => Eric Desrochers (slashd) ** Tags added: sts-sponsors-halves -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1877792 Title: jmespath SyntaxWarning: "is" with a literal. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ansible/+bug/1877792/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1877792] Re: jmespath SyntaxWarning: "is" with a literal.
** Description changed: [IMPACT] * Allow broader Ops/Eng team to consume Ansible from our packages instead of the upstream PyPi repositories in order to fix this warning. * Sanitize package installation: Setting up python3-jmespath (0.9.4-2) ... /usr/lib/python3/dist-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="? [TEST CASE] ** Scenario #1 ** $ pull-lp-source python-jmespath $ cd python-jmespath* - $ python3-coverage run jmespath/visitor.py + $ python3-coverage run jmespath/visitor.py jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="? - if x is 0 or x is 1: + if x is 0 or x is 1: jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="? - if x is 0 or x is 1: + if x is 0 or x is 1: jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="? - elif y is 0 or y is 1: + elif y is 0 or y is 1: jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="? - elif y is 0 or y is 1: + elif y is 0 or y is 1: jmespath/visitor.py:260: SyntaxWarning: "is" with a literal. Did you mean "=="? - if original_result is 0: + if original_result is 0: $ quilt push -a Applying patch 0001-satisfy-python38-syntaxwarning.patch patching file jmespath/visitor.py $ python3-coverage run jmespath/visitor.py ** Scenario #2 ** This could be reproduced outside python-jmespath as follows (a little script I have written to compare result between py2 and py3 : # reproducer_test.py def reproducer(x,y): if x is 0 or x is 1: return y is True or y is False elif y is 0 or y is 1: return x is True or x is False print(reproducer(1,0)) print(reproducer(0,1)) --- $ python2 reproducer_test.py False False $ python3 -W ignore reproducer_test.py False False $ python3 reproducer_test.py test.py:2: SyntaxWarning: "is" with a literal. Did you mean "=="? if x is 0 or x is 1: test.py:2: SyntaxWarning: "is" with a literal. Did you mean "=="? if x is 0 or x is 1: test.py:4: SyntaxWarning: "is" with a literal. Did you mean "=="? elif y is 0 or y is 1: test.py:4: SyntaxWarning: "is" with a literal. Did you mean "=="? elif y is 0 or y is 1: False False With the fix in a small scale (Again, using my reproducer_test.py): # reproducer_test.py def reproducer(x,y): #if x is 0 or x is 1: if type(x) is int and (x == 0 or x == 1): return y is True or y is False #elif y is 0 or y is 1: elif type(y) is int and (y == 0 or y == 1): return x is True or x is False print(reproducer(1,0)) print(reproducer(0,1)) --- # python2 reproducer_test.py False False $ python3 reproducer_test.py False False The above proves that it maintains compatibility in py2 while fixing the "SyntaxWarning "in py3. [WHERE PROBLEM COULD OCCURS] Risk: Low - * Only thing I could see is backward compatibility between py2 and py3 - where both python releases are available in main (e.g. bionic). + * The fix maintain backward compatibility tested with python-coverage, + and other verifications. - But the backward compatibility has been tested already and it didn't - exhibit any potential issue so far. + This package lack of test suite and coverage for things that could have + been easily avoided with proper test in place. There may or may not be + other places in other code path generating syntax warning as this is not + well tested I'm afraid. + + In general, looking upstream: * No observed regression caused by this fix in upstream issues nor in the Ubuntu release where the fix has landed (Focal/Hirsute). * No other py3.8 commits (either fix and/or regression fix) found in the project git log. [OTHER INFORMATIONS] Upstream issue: https://github.com/jmespath/jmespath.py/issues/187 Upstream commit: https://github.com/jmespath/jmespath.py/commit/56263b84cdb0feb7c8d54e426ec472f4dd0de44f [ORIGINAL DESCRIPTIONS] As reported upstream https://github.com/jmespath/jmespath.py/issues/201 Problems installing jmespath in Ubuntu 20.04 LTS Setting up python3-jmespath (0.9.4-2) ... /usr/lib/python3/dist-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="? Fixed upstream in https://github.com/jmespath/jmespath.py/commit/56263b84cdb0feb7c8d54e426ec472f4dd0de44f Impact: this causes applications like Ansible that have dependencies on python-jmespath to send out warnings. Caused by language changes in Python 3.8. System is Ubuntu 20.04 LTS on a Pi 4. emv@pinnatus:~$ apt-cache policy python3-jmespath python3-jmespath: Installed: 0.9.4-2 Candidate: 0.9.4-2 Version table: *** 0.9.4-2 500 500 http://ports.ubuntu.com/ubuntu-ports focal/main arm64
[Bug 1877792] Re: jmespath SyntaxWarning: "is" with a literal.
** Description changed: [IMPACT] * Allow broader Ops/Eng team to consume Ansible from our packages instead of the upstream PyPi repositories in order to fix this warning. * Sanitize package installation: Setting up python3-jmespath (0.9.4-2) ... /usr/lib/python3/dist-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="? [TEST CASE] ** Scenario #1 ** + + $ pull-lp-source python-jmespath + + $ cd python-jmespath* + + $ python3-coverage run jmespath/visitor.py + jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="? + if x is 0 or x is 1: + jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="? + if x is 0 or x is 1: + jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="? + elif y is 0 or y is 1: + jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="? + elif y is 0 or y is 1: + jmespath/visitor.py:260: SyntaxWarning: "is" with a literal. Did you mean "=="? + if original_result is 0: + + $ quilt push -a + Applying patch 0001-satisfy-python38-syntaxwarning.patch + patching file jmespath/visitor.py + + $ python3-coverage run jmespath/visitor.py + + ** Scenario #2 ** This could be reproduced outside python-jmespath as follows (a little script I have written to compare result between py2 and py3 : # reproducer_test.py def reproducer(x,y): if x is 0 or x is 1: return y is True or y is False elif y is 0 or y is 1: return x is True or x is False print(reproducer(1,0)) print(reproducer(0,1)) --- $ python2 reproducer_test.py False False $ python3 -W ignore reproducer_test.py False False $ python3 reproducer_test.py test.py:2: SyntaxWarning: "is" with a literal. Did you mean "=="? if x is 0 or x is 1: test.py:2: SyntaxWarning: "is" with a literal. Did you mean "=="? if x is 0 or x is 1: test.py:4: SyntaxWarning: "is" with a literal. Did you mean "=="? elif y is 0 or y is 1: test.py:4: SyntaxWarning: "is" with a literal. Did you mean "=="? elif y is 0 or y is 1: False False With the fix in a small scale (Again, using my reproducer_test.py): # reproducer_test.py def reproducer(x,y): #if x is 0 or x is 1: if type(x) is int and (x == 0 or x == 1): return y is True or y is False #elif y is 0 or y is 1: elif type(y) is int and (y == 0 or y == 1): return x is True or x is False print(reproducer(1,0)) print(reproducer(0,1)) --- # python2 reproducer_test.py False False $ python3 reproducer_test.py False False The above proves that it maintains compatibility in py2 while fixing the "SyntaxWarning "in py3. [WHERE PROBLEM COULD OCCURS] Risk: Low * Only thing I could see is backward compatibility between py2 and py3 where both python releases are available in main (e.g. bionic). But the backward compatibility has been tested already and it didn't exhibit any potential issue so far. + * No observed regression caused by this fix in upstream issues nor in + the Ubuntu release where the fix has landed (Focal/Hirsute). - * No observed regression caused by this fix in upstream issues nor in the Ubuntu release where the fix has landed (Focal/Hirsute). - - * No other py3.8 commits (either fix and/or regression fix) found in the project git log. - + * No other py3.8 commits (either fix and/or regression fix) found in the + project git log. [OTHER INFORMATIONS] Upstream issue: https://github.com/jmespath/jmespath.py/issues/187 Upstream commit: https://github.com/jmespath/jmespath.py/commit/56263b84cdb0feb7c8d54e426ec472f4dd0de44f [ORIGINAL DESCRIPTIONS] As reported upstream https://github.com/jmespath/jmespath.py/issues/201 Problems installing jmespath in Ubuntu 20.04 LTS Setting up python3-jmespath (0.9.4-2) ... /usr/lib/python3/dist-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="? Fixed upstream in https://github.com/jmespath/jmespath.py/commit/56263b84cdb0feb7c8d54e426ec472f4dd0de44f Impact: this causes applications like Ansible that have dependencies on python-jmespath to send out warnings. Caused by language changes in Python 3.8. System is Ubuntu 20.04 LTS on a Pi 4. emv@pinnatus:~$ apt-cache policy python3-jmespath python3-jmespath: Installed: 0.9.4-2 Candidate: 0.9.4-2 Version table: *** 0.9.4-2 500 500 http://ports.ubuntu.com/ubuntu-ports focal/main arm64 Packages 100 /var/lib/dpkg/status -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1877792 Title: jmespath SyntaxWarning: "is" with a literal. To manage notifications about this bug go to:
[Bug 1877792] Re: jmespath SyntaxWarning: "is" with a literal.
** Description changed: [IMPACT] * Allow broader Ops/Eng team to consume Ansible from our packages instead of the upstream PyPi repositories in order to fix this warning. * Sanitize package installation: Setting up python3-jmespath (0.9.4-2) ... /usr/lib/python3/dist-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="? [TEST CASE] ** Scenario #1 ** This could be reproduced outside python-jmespath as follows (a little script I have written to compare result between py2 and py3 : # reproducer_test.py def reproducer(x,y): if x is 0 or x is 1: return y is True or y is False elif y is 0 or y is 1: return x is True or x is False print(reproducer(1,0)) print(reproducer(0,1)) --- $ python2 reproducer_test.py False False - $ python3 -W ignore reproducer_test.py + $ python3 -W ignore reproducer_test.py False False $ python3 reproducer_test.py test.py:2: SyntaxWarning: "is" with a literal. Did you mean "=="? if x is 0 or x is 1: test.py:2: SyntaxWarning: "is" with a literal. Did you mean "=="? if x is 0 or x is 1: test.py:4: SyntaxWarning: "is" with a literal. Did you mean "=="? elif y is 0 or y is 1: test.py:4: SyntaxWarning: "is" with a literal. Did you mean "=="? elif y is 0 or y is 1: False False With the fix in a small scale (Again, using my reproducer_test.py): # reproducer_test.py def reproducer(x,y): #if x is 0 or x is 1: if type(x) is int and (x == 0 or x == 1): return y is True or y is False #elif y is 0 or y is 1: elif type(y) is int and (y == 0 or y == 1): return x is True or x is False print(reproducer(1,0)) print(reproducer(0,1)) --- # python2 reproducer_test.py False False $ python3 reproducer_test.py False False The above proves that it maintains compatibility in py2 while fixing the "SyntaxWarning "in py3. [WHERE PROBLEM COULD OCCURS] - Only thing I could see is backward compatibility between py2 and py3 where both python releases are available in main (e.g. bionic). + + Risk: Low + + * Only thing I could see is backward compatibility between py2 and py3 + where both python releases are available in main (e.g. bionic). But the backward compatibility has been tested already and it didn't exhibit any potential issue so far. - All I could think of atm. + + * No observed regression caused by this fix in upstream issues nor in the Ubuntu release where the fix has landed (Focal/Hirsute). + + * No other py3.8 commits (either fix and/or regression fix) found in the project git log. + [OTHER INFORMATIONS] Upstream issue: https://github.com/jmespath/jmespath.py/issues/187 Upstream commit: https://github.com/jmespath/jmespath.py/commit/56263b84cdb0feb7c8d54e426ec472f4dd0de44f [ORIGINAL DESCRIPTIONS] As reported upstream https://github.com/jmespath/jmespath.py/issues/201 Problems installing jmespath in Ubuntu 20.04 LTS Setting up python3-jmespath (0.9.4-2) ... /usr/lib/python3/dist-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="? Fixed upstream in https://github.com/jmespath/jmespath.py/commit/56263b84cdb0feb7c8d54e426ec472f4dd0de44f Impact: this causes applications like Ansible that have dependencies on python-jmespath to send out warnings. Caused by language changes in Python 3.8. System is Ubuntu 20.04 LTS on a Pi 4. emv@pinnatus:~$ apt-cache policy python3-jmespath python3-jmespath: Installed: 0.9.4-2 Candidate: 0.9.4-2 Version table: *** 0.9.4-2 500 500 http://ports.ubuntu.com/ubuntu-ports focal/main arm64 Packages 100 /var/lib/dpkg/status -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1877792 Title: jmespath SyntaxWarning: "is" with a literal. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ansible/+bug/1877792/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1877792] Re: jmespath SyntaxWarning: "is" with a literal.
** Description changed: [IMPACT] * Allow broader Ops/Eng team to consume Ansible from our packages instead of the upstream PyPi repositories in order to fix this warning. * Sanitize package installation: Setting up python3-jmespath (0.9.4-2) ... /usr/lib/python3/dist-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="? [TEST CASE] ** Scenario #1 ** This could be reproduced outside python-jmespath as follows (a little script I have written to compare result between py2 and py3 : # reproducer_test.py def reproducer(x,y): if x is 0 or x is 1: return y is True or y is False elif y is 0 or y is 1: return x is True or x is False print(reproducer(1,0)) print(reproducer(0,1)) --- $ python2 reproducer_test.py + False + False + + $ python3 -W ignore reproducer_test.py False False $ python3 reproducer_test.py test.py:2: SyntaxWarning: "is" with a literal. Did you mean "=="? if x is 0 or x is 1: test.py:2: SyntaxWarning: "is" with a literal. Did you mean "=="? if x is 0 or x is 1: test.py:4: SyntaxWarning: "is" with a literal. Did you mean "=="? elif y is 0 or y is 1: test.py:4: SyntaxWarning: "is" with a literal. Did you mean "=="? elif y is 0 or y is 1: False False With the fix in a small scale (Again, using my reproducer_test.py): # reproducer_test.py def reproducer(x,y): #if x is 0 or x is 1: if type(x) is int and (x == 0 or x == 1): return y is True or y is False #elif y is 0 or y is 1: elif type(y) is int and (y == 0 or y == 1): return x is True or x is False print(reproducer(1,0)) print(reproducer(0,1)) --- # python2 reproducer_test.py False False $ python3 reproducer_test.py False False The above proves that it maintains compatibility in py2 while fixing the "SyntaxWarning "in py3. [WHERE PROBLEM COULD OCCURS] + Only thing I could see is backward compatibility between py2 and py3 where both python releases are available in main (e.g. bionic). + + But the backward compatibility has been tested already and it didn't + exhibit any potential issue so far. + + All I could think of atm. [OTHER INFORMATIONS] Upstream issue: https://github.com/jmespath/jmespath.py/issues/187 Upstream commit: https://github.com/jmespath/jmespath.py/commit/56263b84cdb0feb7c8d54e426ec472f4dd0de44f [ORIGINAL DESCRIPTIONS] As reported upstream https://github.com/jmespath/jmespath.py/issues/201 Problems installing jmespath in Ubuntu 20.04 LTS Setting up python3-jmespath (0.9.4-2) ... /usr/lib/python3/dist-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="? Fixed upstream in https://github.com/jmespath/jmespath.py/commit/56263b84cdb0feb7c8d54e426ec472f4dd0de44f Impact: this causes applications like Ansible that have dependencies on python-jmespath to send out warnings. Caused by language changes in Python 3.8. System is Ubuntu 20.04 LTS on a Pi 4. emv@pinnatus:~$ apt-cache policy python3-jmespath python3-jmespath: Installed: 0.9.4-2 Candidate: 0.9.4-2 Version table: *** 0.9.4-2 500 500 http://ports.ubuntu.com/ubuntu-ports focal/main arm64 Packages 100 /var/lib/dpkg/status -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1877792 Title: jmespath SyntaxWarning: "is" with a literal. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ansible/+bug/1877792/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1877792] Re: jmespath SyntaxWarning: "is" with a literal.
** Description changed: + [IMPACT] + + [TEST CASE] + + ** Scenario #1 ** + This could be reproduced outside python-jmespath as follows (a little script I have written to compare result between py2 and py3 : + + # reproducer_test.py + + def reproducer(x,y): + if x is 0 or x is 1: + return y is True or y is False + elif y is 0 or y is 1: + return x is True or x is False + + print(reproducer(1,0)) + print(reproducer(0,1)) + --- + + $ python2 reproducer_test.py + False + False + + $ python3 reproducer_test.py + test.py:2: SyntaxWarning: "is" with a literal. Did you mean "=="? + if x is 0 or x is 1: + test.py:2: SyntaxWarning: "is" with a literal. Did you mean "=="? + if x is 0 or x is 1: + test.py:4: SyntaxWarning: "is" with a literal. Did you mean "=="? + elif y is 0 or y is 1: + test.py:4: SyntaxWarning: "is" with a literal. Did you mean "=="? + elif y is 0 or y is 1: + False + False + + + With the fix in a small scale (Again, using my reproducer_test.py): + + def reproducer(x,y): + #if x is 0 or x is 1: + if type(x) is int and (x == 0 or x == 1): + return y is True or y is False + #elif y is 0 or y is 1: + elif type(y) is int and (y == 0 or y == 1): + return x is True or x is False + + print(reproducer(1,0)) + print(reproducer(0,1)) + + # python2 reproducer_test.py + False + False + + $ python3 reproducer_test.py + False + False + + [WHERE PROBLEM COULD OCCURS] + + [OTHER INFORMATIONS] + As reported upstream https://github.com/jmespath/jmespath.py/issues/201 Problems installing jmespath in Ubuntu 20.04 LTS Setting up python3-jmespath (0.9.4-2) ... /usr/lib/python3/dist-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="? Fixed upstream in https://github.com/jmespath/jmespath.py/commit/56263b84cdb0feb7c8d54e426ec472f4dd0de44f Impact: this causes applications like Ansible that have dependencies on python-jmespath to send out warnings. Caused by language changes in Python 3.8. System is Ubuntu 20.04 LTS on a Pi 4. emv@pinnatus:~$ apt-cache policy python3-jmespath python3-jmespath: - Installed: 0.9.4-2 - Candidate: 0.9.4-2 - Version table: - *** 0.9.4-2 500 - 500 http://ports.ubuntu.com/ubuntu-ports focal/main arm64 Packages - 100 /var/lib/dpkg/status + Installed: 0.9.4-2 + Candidate: 0.9.4-2 + Version table: + *** 0.9.4-2 500 + 500 http://ports.ubuntu.com/ubuntu-ports focal/main arm64 Packages + 100 /var/lib/dpkg/status ** Description changed: [IMPACT] [TEST CASE] ** Scenario #1 ** This could be reproduced outside python-jmespath as follows (a little script I have written to compare result between py2 and py3 : # reproducer_test.py def reproducer(x,y): - if x is 0 or x is 1: - return y is True or y is False - elif y is 0 or y is 1: - return x is True or x is False + if x is 0 or x is 1: + return y is True or y is False + elif y is 0 or y is 1: + return x is True or x is False print(reproducer(1,0)) print(reproducer(0,1)) --- - $ python2 reproducer_test.py + $ python2 reproducer_test.py False False - $ python3 reproducer_test.py + $ python3 reproducer_test.py test.py:2: SyntaxWarning: "is" with a literal. Did you mean "=="? - if x is 0 or x is 1: + if x is 0 or x is 1: test.py:2: SyntaxWarning: "is" with a literal. Did you mean "=="? - if x is 0 or x is 1: + if x is 0 or x is 1: test.py:4: SyntaxWarning: "is" with a literal. Did you mean "=="? - elif y is 0 or y is 1: + elif y is 0 or y is 1: test.py:4: SyntaxWarning: "is" with a literal. Did you mean "=="? - elif y is 0 or y is 1: + elif y is 0 or y is 1: False False - With the fix in a small scale (Again, using my reproducer_test.py): + # reproducer_test.py + def reproducer(x,y): #if x is 0 or x is 1: - if type(x) is int and (x == 0 or x == 1): - return y is True or y is False + if type(x) is int and (x == 0 or x == 1): + return y is True or y is False #elif y is 0 or y is 1: - elif type(y) is int and (y == 0 or y == 1): - return x is True or x is False + elif type(y) is int and (y == 0 or y == 1): + return x is True or x is False print(reproducer(1,0)) print(reproducer(0,1)) + --- # python2 reproducer_test.py False False - $ python3 reproducer_test.py + $ python3 reproducer_test.py False False [WHERE PROBLEM COULD OCCURS] [OTHER INFORMATIONS] As reported upstream https://github.com/jmespath/jmespath.py/issues/201 Problems installing jmespath in Ubuntu 20.04 LTS Setting up python3-jmespath (0.9.4-2) ... /usr/lib/python3/dist-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="? Fixed upstream in
[Bug 1877792] Re: jmespath SyntaxWarning: "is" with a literal.
** Also affects: ansible (Ubuntu Focal) Importance: Undecided Status: New ** Also affects: python-jmespath (Ubuntu Focal) Importance: Undecided Status: New ** Also affects: ansible (Ubuntu Impish) Importance: Undecided Status: Invalid ** Also affects: python-jmespath (Ubuntu Impish) Importance: Undecided Status: Fix Released ** Also affects: ansible (Ubuntu Bionic) Importance: Undecided Status: New ** Also affects: python-jmespath (Ubuntu Bionic) Importance: Undecided Status: New ** Also affects: ansible (Ubuntu Hirsute) Importance: Undecided Status: New ** Also affects: python-jmespath (Ubuntu Hirsute) Importance: Undecided Status: New ** Changed in: python-jmespath (Ubuntu Hirsute) Status: New => Fix Released -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1877792 Title: jmespath SyntaxWarning: "is" with a literal. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ansible/+bug/1877792/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1877792] Re: jmespath SyntaxWarning: "is" with a literal.
Version information for python-jmespath in the Ubuntu 20.04 LXC Linux container: root@afns1:/# dpkg -l | grep jmespath ii python3-jmespath 0.9.4-2 all JSON Matching Expressions (Python 3) -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1877792 Title: jmespath SyntaxWarning: "is" with a literal. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ansible/+bug/1877792/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1877792] Re: jmespath SyntaxWarning: "is" with a literal.
Hi, I am also seeing this error when running the following install in a Ubuntu 20.04 focal fossa on amd64 running in an LXC Linux Container: The command run is: COMMAND=/bin/lxc-attach -n nsa -- sudo apt-get -y install bind9 isc- dhcp-server bind9utils dnsutils openssh-server man awscli sshpass During installation of those package, the following output is observed: Setting up python3-jmespath (0.9.4-2) ... /usr/lib/python3/dist-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="? if x is 0 or x is 1: /usr/lib/python3/dist-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="? if x is 0 or x is 1: /usr/lib/python3/dist-packages/jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="? elif y is 0 or y is 1: /usr/lib/python3/dist-packages/jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="? elif y is 0 or y is 1: /usr/lib/python3/dist-packages/jmespath/visitor.py:260: SyntaxWarning: "is" with a literal. Did you mean "=="? if original_result is 0: The warnings do not seem to affect operation of the system or the installation of the packages in any observed way so far. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1877792 Title: jmespath SyntaxWarning: "is" with a literal. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ansible/+bug/1877792/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1877792] Re: jmespath SyntaxWarning: "is" with a literal.
** Changed in: python-jmespath (Debian) Status: Unknown => Fix Released -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1877792 Title: jmespath SyntaxWarning: "is" with a literal. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ansible/+bug/1877792/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1877792] Re: jmespath SyntaxWarning: "is" with a literal.
python-jmespath (0.9.5-1) unstable; urgency=medium [ TANIGUCHI Takaki ] * add CI config * New upstream version 0.9.5 - Fix SyntaxWarning (Closes: #953534) * Set upstream metadata fields: Bug-Database, Bug-Submit, Repository, Repository-Browse. * Update standards version to 4.4.1, no changes needed. -- TANIGUCHI Takaki Wed, 01 Apr 2020 16:35:10 +0900 ** Bug watch added: Debian Bug tracker #953534 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=953534 ** Also affects: python-jmespath (Debian) via https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=953534 Importance: Unknown Status: Unknown ** Changed in: ansible (Ubuntu) Status: Confirmed => Invalid ** Changed in: python-jmespath (Ubuntu) Status: Confirmed => Fix Released -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1877792 Title: jmespath SyntaxWarning: "is" with a literal. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ansible/+bug/1877792/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1877792] Re: jmespath SyntaxWarning: "is" with a literal.
It looks like https://launchpad.net/ubuntu/+source/python- jmespath/0.9.5-1 addresses this issue, from Groovy and Sid. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1877792 Title: jmespath SyntaxWarning: "is" with a literal. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ansible/+bug/1877792/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1877792] Re: jmespath SyntaxWarning: "is" with a literal.
I confirm this. Running any Ansible playbook displays the following warning on every task which is quite annoying: /usr/lib/python3/dist-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="? if x is 0 or x is 1: /usr/lib/python3/dist-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="? if x is 0 or x is 1: /usr/lib/python3/dist-packages/jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="? elif y is 0 or y is 1: /usr/lib/python3/dist-packages/jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="? elif y is 0 or y is 1: /usr/lib/python3/dist-packages/jmespath/visitor.py:260: SyntaxWarning: "is" with a literal. Did you mean "=="? if original_result is 0: The system is Ubuntu 20.04 LTS on amd64. $ apt-cache policy ansible python3-jmespath ansible: Installed: 2.9.6+dfsg-1 Candidate: 2.9.6+dfsg-1 Version table: *** 2.9.6+dfsg-1 500 500 http://www.nic.funet.fi/pub/mirrors/archive.ubuntu.com focal/universe amd64 Packages 500 http://www.nic.funet.fi/pub/mirrors/archive.ubuntu.com focal/universe i386 Packages 100 /var/lib/dpkg/status python3-jmespath: Installed: 0.9.4-2 Candidate: 0.9.4-2 Version table: *** 0.9.4-2 500 500 http://www.nic.funet.fi/pub/mirrors/archive.ubuntu.com focal/main amd64 Packages 500 http://www.nic.funet.fi/pub/mirrors/archive.ubuntu.com focal/main i386 Packages 100 /var/lib/dpkg/status -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1877792 Title: jmespath SyntaxWarning: "is" with a literal. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ansible/+bug/1877792/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1877792] Re: jmespath SyntaxWarning: "is" with a literal.
Status changed to 'Confirmed' because the bug affects multiple users. ** Changed in: python-jmespath (Ubuntu) Status: New => Confirmed -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1877792 Title: jmespath SyntaxWarning: "is" with a literal. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ansible/+bug/1877792/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1877792] Re: jmespath SyntaxWarning: "is" with a literal.
Status changed to 'Confirmed' because the bug affects multiple users. ** Changed in: ansible (Ubuntu) Status: New => Confirmed -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1877792 Title: jmespath SyntaxWarning: "is" with a literal. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ansible/+bug/1877792/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs