Skip to contentSkip to conversation

[2.8][PATCH] fetch2/git: Use quote from shlex, not pipes

PATCH Martin Jansa 3 participants 3 messages Nov 28, 2024

lore
Share & tools
lore
#0 lore raw

From: Richard Purdie <[email protected]>

The pipes module is removed in python 3.13. It was already using the quote function from shlex so use that directly instead.

The module already imports shlex too so it is an easy substitution.

---
 lib/bb/fetch2/git.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
lib/bb/fetch2/git.py +1 -2
index c7ff769fd..602914460 100644
@@ -926,9 +926,8 @@ class Git(FetchMethod):
             commits = None
         else:
             if not os.path.exists(rev_file) or not os.path.getsize(rev_file):
-                from pipes import quote
                 commits = bb.fetch2.runfetchcmd(
-                        "git rev-list %s -- | wc -l" % quote(rev),
+                        "git rev-list %s -- | wc -l" % shlex.quote(rev),
                         d, quiet=True).strip().lstrip('0')
                 if commits:
                     open(rev_file, "w").write("%d\n" % int(commits))
Signature · 1 line
2.47.1
#1 lore raw
Quoted 11 lines · Martin Jansa

From: Richard Purdie <[email protected]>

The pipes module is removed in python 3.13. It was already using the quote function from shlex so use that directly instead.

The module already imports shlex too so it is an easy substitution.

---
 lib/bb/fetch2/git.py | 3 +--

 1 file changed, 1 insertion(+), 2 deletions(-)

I've put that on the branch and will let Steve pick it up from there for poky.

Cheers,

Richard

#2 lore raw
Quoted 9 lines · Richard Purdie
Quoted 7 lines · Martin Jansa

From: Richard Purdie <[email protected]>

The pipes module is removed in python 3.13. It was already using the quote function from shlex so use that directly instead.

The module already imports shlex too so it is an easy substitution.

Quoted 7 lines
Quoted 4 lines
---
 lib/bb/fetch2/git.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

I've put that on the branch and will let Steve pick it up from there for poky.

Done!

Steve