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

Fix import error on Python 3.13 #684

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

cjwatson
Copy link
Contributor

SUMMARY

Rework escape_param to work on Python 3.13. One of shlex.quote or pipes.quote exists on all Python versions (back to Python 0.9.8!), so the fallback code for systems that have neither is unnecessary.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

module_utils

Rework `escape_param` to work on Python 3.13.  One of `shlex.quote` or
`pipes.quote` exists on all Python versions (back to Python 0.9.8!), so
the fallback code for systems that have neither is unnecessary.
Copy link

codecov bot commented Oct 29, 2024

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 73.44%. Comparing base (42d35bd) to head (f4b34f5).
Report is 25 commits behind head on master.

Files with missing lines Patch % Lines
plugins/module_utils/mongodb_shell.py 60.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #684      +/-   ##
==========================================
- Coverage   73.68%   73.44%   -0.25%     
==========================================
  Files           6        6              
  Lines         935      934       -1     
  Branches      144      143       -1     
==========================================
- Hits          689      686       -3     
  Misses        210      210              
- Partials       36       38       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rhysmeister
Copy link
Collaborator

I never used Python as far back as Python 0.9.8. But I did have a docker image that had neither of these libraries. Perhaps that was pretty unusual. Seems to not be an issue in the CI anymore.

@cjwatson
Copy link
Contributor Author

cjwatson commented Oct 30, 2024

I think that image must have been mangled in some way to remove parts of the standard library. I'm surprised anything worked there ...

@rhysmeister
Copy link
Collaborator

Yes probably. But it's gone now. Merging!

@rhysmeister rhysmeister merged commit 30def22 into ansible-collections:master Oct 30, 2024
202 of 204 checks passed
@cjwatson cjwatson deleted the py313 branch October 30, 2024 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants