Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More SyntaxWarning issues with Python 3.8 #4833

Open
john-aws opened this issue Jan 10, 2020 · 19 comments
Open

More SyntaxWarning issues with Python 3.8 #4833

john-aws opened this issue Jan 10, 2020 · 19 comments

Comments

@john-aws
Copy link

@john-aws john-aws commented Jan 10, 2020

I'm seeing SyntaxWarning issues with the latest awscli and Python 3.8 versions.

john:~$ aws --version
aws-cli/1.16.310 Python/3.8.1 Darwin/18.7.0 botocore/1.13.46

Symptoms:

john:~$ aws s3 sync src/ s3://my-backup/src/
/usr/local/Cellar/awscli/1.16.310_1/libexec/lib/python3.8/site-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if x is 0 or x is 1:
/usr/local/Cellar/awscli/1.16.310_1/libexec/lib/python3.8/site-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if x is 0 or x is 1:
/usr/local/Cellar/awscli/1.16.310_1/libexec/lib/python3.8/site-packages/jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif y is 0 or y is 1:
/usr/local/Cellar/awscli/1.16.310_1/libexec/lib/python3.8/site-packages/jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif y is 0 or y is 1:
/usr/local/Cellar/awscli/1.16.310_1/libexec/lib/python3.8/site-packages/jmespath/visitor.py:260: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if original_result is 0:
@opub

This comment has been minimized.

Copy link

@opub opub commented Jan 13, 2020

I am seeing the same thing on a new clean machine.
aws-cli/1.17.0 Python/3.8.1 Darwin/19.2.0 botocore/1.14.0

@wjam

This comment has been minimized.

Copy link

@wjam wjam commented Jan 14, 2020

This issue in the jmespath library appears to be tracking the problems with that library that causes those messages
jmespath/jmespath.py#187

bayandin referenced this issue in Homebrew/homebrew-core Jan 16, 2020
@bayandin bayandin mentioned this issue Jan 23, 2020
4 of 5 tasks complete
@temal-

This comment has been minimized.

Copy link

@temal- temal- commented Jan 24, 2020

This should be fixed in 1.17.7 and 1.17.8. I tested both versions and could not see any more SyntaxWarning messages.

@dashmug

This comment has been minimized.

Copy link

@dashmug dashmug commented Jan 25, 2020

I'm using

aws-cli/1.17.8 
Python/3.8.1 
Darwin/19.2.0 
botocore/1.14.8

and yet the warnings still show up.

Also, my aws-cli is installed via Homebrew (i.e. brew install awscli). Not sure if installing via pip is better.

@temal-

This comment has been minimized.

Copy link

@temal- temal- commented Jan 25, 2020

On what commands do you see the warnings?

@robvanderleek

This comment has been minimized.

Copy link

@robvanderleek robvanderleek commented Jan 25, 2020

I have these warnings too:

$ aws --version
/usr/local/Cellar/awscli/1.17.8/libexec/lib/python3.8/site-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if x is 0 or x is 1:
/usr/local/Cellar/awscli/1.17.8/libexec/lib/python3.8/site-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if x is 0 or x is 1:
/usr/local/Cellar/awscli/1.17.8/libexec/lib/python3.8/site-packages/jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif y is 0 or y is 1:
/usr/local/Cellar/awscli/1.17.8/libexec/lib/python3.8/site-packages/jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif y is 0 or y is 1:
/usr/local/Cellar/awscli/1.17.8/libexec/lib/python3.8/site-packages/jmespath/visitor.py:260: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if original_result is 0:
aws-cli/1.17.8 Python/3.8.1 Darwin/19.2.0 botocore/1.14.8
@saidsef

This comment has been minimized.

Copy link

@saidsef saidsef commented Jan 25, 2020

Had the same issue, upgraded outdated python modules and voila the SyntaxWarning message went away.

Here is the command to update:

pip3 list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1  | xargs -n1 pip3 install -U
@robvanderleek

This comment has been minimized.

Copy link

@robvanderleek robvanderleek commented Jan 26, 2020

I installed awscli via Homebrew but there's no update available yet that fixes these warnings.

@tayfunyasar

This comment has been minimized.

Copy link

@tayfunyasar tayfunyasar commented Jan 28, 2020

i have same issue.

tayfun@tayfun-tayfun:~$ aws --version
aws-cli/1.17.8 Python/3.8.1 Linux/5.3.0-26-generic botocore/1.14.8

@hicklemon

This comment has been minimized.

Copy link

@hicklemon hicklemon commented Jan 28, 2020

Uninstalling awscli from brew and installing it via pip3, which I do concede is not ideal since it's system-wide Python, cleaned up these warnings for me.

brew uninstall awscli
sudo pip3 install awscli
$ aws --version
aws-cli/1.17.9 Python/3.7.6 Darwin/19.2.0 botocore/1.14.9
@NobleUplift

This comment has been minimized.

Copy link

@NobleUplift NobleUplift commented Jan 28, 2020

Well, it seems I went from one error to the next. Initially started with this error so I upgraded Python which forced an update of awscli, and here I am.

dyld: Library not loaded: @executable_path/../.Python
  Referenced from: /usr/local/Cellar/awscli/1.14.30/libexec/bin/python3.6

@saidsef 's command above worked for me! No more errors with brew awscli.

@gitromba

This comment has been minimized.

Copy link

@gitromba gitromba commented Jan 28, 2020

Had the same issue, upgraded outdated python modules and voila the SyntaxWarning message went away.

Here is the command to update:

pip3 list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1  | xargs -n1 pip3 install -U

Thanks saidsef, works like a charm, annoying warning messages are gone!

@hicklemon

This comment has been minimized.

Copy link

@hicklemon hicklemon commented Jan 28, 2020

Please be careful allowing pip to mass-upgrade modules -- you could conflict with python packages installed by your system's package manager, resulting in issues when performing a full system upgrade.

It is advised that you instead uninstall awscli, and pip install it.

@at0ms at0ms mentioned this issue Jan 28, 2020
5 of 5 tasks complete
@at0ms

This comment has been minimized.

Copy link

@at0ms at0ms commented Jan 28, 2020

Built awscli formula locally with 1.17.9 artifact. Python syntax warnings stopped.

Workaround is cloning homebrew-core.git locally, tick the archive/package version in Formula/awscli.rb to .9 , then:

brew upgrade --build-from-source ./Formula/awscli.rb

Your brew managed awscli should now be at 1.17.9

@bugre

This comment has been minimized.

Copy link

@bugre bugre commented Feb 13, 2020

Check if you don't have two version of awscli installed (brew and pip)

Had similar warnings and could not figure out why, as i had everything updated...
Found out it was related to having two install's of awscli. Long long time ago i had installed awscli with pip (awscli-1.16.130), and later moved to brew version (after updating today it's awscli: stable 2.0.0) but didn't unistall the old version.
Path pointed (as far i could find out) to the correct brew version, but for some reason the old installed 'pip3' version was generating havoc...

to check:
brew info awscli
pip3 list installed |grep awscli

after i removed the pip version, my brew installed awscli stopped complaining about 'if x is 0 or x is 1:' ...

pip3 uninstall awscli

@slmingol

This comment has been minimized.

Copy link

@slmingol slmingol commented Feb 18, 2020

I was experiencing a similar issue, pip uninstall jmespath resolved the issue. I had jmespath installed via brew.

@davidplappert

This comment has been minimized.

Copy link

@davidplappert davidplappert commented Feb 24, 2020

/usr/local/Cellar/awscli/2.0.0/libexec/lib/python3.8/site-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if x is 0 or x is 1:
/usr/local/Cellar/awscli/2.0.0/libexec/lib/python3.8/site-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if x is 0 or x is 1:
/usr/local/Cellar/awscli/2.0.0/libexec/lib/python3.8/site-packages/jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif y is 0 or y is 1:
/usr/local/Cellar/awscli/2.0.0/libexec/lib/python3.8/site-packages/jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif y is 0 or y is 1:
/usr/local/Cellar/awscli/2.0.0/libexec/lib/python3.8/site-packages/jmespath/visitor.py:260: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if original_result is 0:

Error on a brand new Macbook, fresh mac OS, all updated installed. Installed with brew.

@angusfz

This comment has been minimized.

Copy link

@angusfz angusfz commented Feb 25, 2020

/usr/local/Cellar/awscli/2.0.0/libexec/lib/python3.8/site-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if x is 0 or x is 1:
/usr/local/Cellar/awscli/2.0.0/libexec/lib/python3.8/site-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if x is 0 or x is 1:
/usr/local/Cellar/awscli/2.0.0/libexec/lib/python3.8/site-packages/jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif y is 0 or y is 1:
/usr/local/Cellar/awscli/2.0.0/libexec/lib/python3.8/site-packages/jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif y is 0 or y is 1:
/usr/local/Cellar/awscli/2.0.0/libexec/lib/python3.8/site-packages/jmespath/visitor.py:260: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if original_result is 0:

Error on a brand new Macbook, fresh mac OS, all updated installed. Installed with brew.

The same issue and resolved by pip install --upgrade jmespath

@weyderfs

This comment has been minimized.

Copy link

@weyderfs weyderfs commented Feb 28, 2020

I was experiencing a similar issue, pip uninstall jmespath resolved the issue. I had jmespath installed via brew.

I made a little bit different, I my jmespath was installed by PIP using python 2.7...
So I uninstall and re-install using pip3 and solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

You can’t perform that action at this time.