-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Warnings when using Python 3.12 #8547
Comments
Thanks for reaching out and for your patience here I could not reproduce this issue with that AWS CLI version using Python 3.12. Is this still something that you are seeing? And have you tried updating your version of the CLI? The latest version of v1 is 1.32.100 per the CHANGELOG. |
Yes, still seeing it in v1.32.100. Click below to see full details of reproduction. Note that when find / -xdev -name __pycache__ -exec rm -rf {} \; -prune to see the error when the files are recompiled on demand. Removing the cached files is common when creating a Docker image, in order to reduce the size of the image. My understanding is that in Python 3.13, these warnings will no longer be able to be suppressed, and will instead be full errors, so time spent fixing this now will be time saved later. Click to reveal terminal capture of reproduction
|
Thanks for clarifying — there have been other DeprectionWarnings issues reported across our repositories for Python 3.12 but those seem to relate to datetime issues. Will mark this issue for further review by the team. |
@tim-finnigan @nateprewitt this was fixed in #8925, I guess, you can close it as completed. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Whenever the awscli utility is used it prints a bunch of warning messages which obscures the regular output. An example of a warning is: SyntaxWarning: invalid escape sequence '\s' _distributor_id_file_re = re.compile("(?:DISTRIB_ID\s*=)\s*(.*)", re.I) See: - aws/aws-cli#8547 - aws/aws-cli#8925
Describe the bug
When compiling CLI v1 under Python 3.12, Python emits a long string of warnings related to invalid escape sequences in regular expressions:
Full version string:
Expected Behavior
No warnings emitted from a supported version of Python.
Current Behavior
9 separate warnings emitted about "invalid escape sequence".
Note this only happens when the code is compiled, which can be hidden by install process. However, when packaged in a Docker container, the compiled code is often removed, and the error shows up on first use when the code is recompiled.
Reproduction Steps
pip install --prefix=/usr/local --no-build-isolation awscli==1.32.48
find / -xdev -name __pycache__ -exec rm -rf {} \; -prune
aws --version
Possible Solution
Use raw strings instead of string literals. See example here
Additional Information/Context
From Stack Overflow:
CLI version used
1.32.48
Environment details (OS name and version, etc.)
aws-cli/1.32.48 Python/3.12.2 Linux/6.6.12-linuxkit botocore/1.34.48 Debian 12.4
The text was updated successfully, but these errors were encountered: