[libcxx] [test] Use shlex.quote() to fix Python 3.13 compatibility#93376
Merged
[libcxx] [test] Use shlex.quote() to fix Python 3.13 compatibility#93376
shlex.quote() to fix Python 3.13 compatibility#93376Conversation
Replace the use of `pipes.quote()` with `shlex.quote()` to fix compatibility with Python 3.13. The former was always an undocumented alias to the latter, and the `pipes` module was removed completely in Python 3.13. Fixes llvm#93375
Member
|
@llvm/pr-subscribers-libcxx Author: Michał Górny (mgorny) ChangesReplace the use of Fixes #93375 Full diff: https://github.com/llvm/llvm-project/pull/93376.diff 2 Files Affected:
diff --git a/libcxx/test/libcxx/lit.local.cfg b/libcxx/test/libcxx/lit.local.cfg
index 147367323d4a6..4467d8070cc70 100644
--- a/libcxx/test/libcxx/lit.local.cfg
+++ b/libcxx/test/libcxx/lit.local.cfg
@@ -1,4 +1,5 @@
# The tests in this directory need to run Python
-import pipes, sys
+import shlex
+import sys
-config.substitutions.append(("%{python}", pipes.quote(sys.executable)))
+config.substitutions.append(("%{python}", shlex.quote(sys.executable)))
diff --git a/libcxx/utils/libcxx/test/dsl.py b/libcxx/utils/libcxx/test/dsl.py
index 387862ae6f496..7ac66d449b1cf 100644
--- a/libcxx/utils/libcxx/test/dsl.py
+++ b/libcxx/utils/libcxx/test/dsl.py
@@ -8,8 +8,8 @@
import os
import pickle
-import pipes
import platform
+import shlex
import shutil
import tempfile
@@ -290,7 +290,7 @@ def hasAnyLocale(config, locales):
}
#endif
"""
- return programSucceeds(config, program, args=[pipes.quote(l) for l in locales])
+ return programSucceeds(config, program, args=[shlex.quote(l) for l in locales])
@_memoizeExpensiveOperation(lambda c, flags="": (c.substitutions, c.environment, flags))
|
Member
|
CI failures are flukes, merging. |
Member
Author
|
Thanks! |
Member
Author
|
@ldionne, do you think we could backport this to 18.x too? It's rather trivial change, and previous LLVM versions tend to linger for years. |
Member
|
@mgorny Yes, you can follow the cherry-pick request process and I'll approve it. Are we still doing point releases for LLVM 18 though? |
Member
Author
|
Oh, we aren't indeed. I haven't noticed, thanks for letting me know. |
Leo3418
pushed a commit
to yxlvcs-rit/csci-352-2241
that referenced
this pull request
Oct 28, 2024
The 'pipes' Python module has been deprecated for a while and been removed in Python 3.13 [1]. A drop-in replacement for 'pipes.quote()' is 'shlex.quote()' [2][3]. [1]: https://www.python.org/downloads/release/python-3130/ [2]: tox-dev/tox#2418 [3]: llvm/llvm-project#93376
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the use of
pipes.quote()withshlex.quote()to fix compatibility with Python 3.13. The former was always an undocumented alias to the latter, and thepipesmodule was removed completely in Python 3.13.Fixes #93375