jmespath / jmespath.py

JMESPath is a query language for JSON.
http://jmespath.org
MIT License
2.19k stars 181 forks source link

Problems installing jmespath in Ubuntu 20.04 LTS #201

Closed Tomasthanes closed 4 years ago

Tomasthanes commented 4 years ago

I'm running Ubuntu 20.04 LTS in a VirtualBox VM and I just tried to install ansible with the following command line:

sudo apt-get install ansible -y

One of the dependencies that it installed was jmespath and I saw the following output from apt-get:

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:

I'm guessing that this is not the result you expected. Is there any additional information that I can provide you?

I've attached a text file with all of the apt-get output. apt-get output.txt

redhatstuart commented 4 years ago

Switching the above code references to == instead of "is" remediates this.

Tomasthanes commented 4 years ago

Is this something that the tens of thousands of package installers are supposed to do or would you do this in the next release of the package?

jamesls commented 4 years ago

Fixed via https://github.com/jmespath/jmespath.py/issues/187 but not released (only in develop right now). I'll get a release out either today or Monday.

Tomasthanes commented 4 years ago

Thank you for the quick response!

vielmetti commented 4 years ago

Reported upstream to Ubuntu as

https://bugs.launchpad.net/ubuntu/+source/ansible/+bug/1877792 https://bugs.launchpad.net/ubuntu/+source/python-jmespath/+bug/1877792