Commit b7a21040 authored by Jelle van der Waa's avatar Jelle van der Waa Committed by Holger Levsen
Browse files

reprotest: pipes module will be removed in Python 3.13



pipes.quote() was already deprecated in Python 2.7 but silently got
aliased to `shlex.quote()`. Python 3.13 removes the `pipes` module and
thus the alias.

Signed-off-by: default avatarJelle van der Waa <jelle@archlinux.org>
Signed-off-by: default avatarHolger Levsen <holger@layer-acht.org>
parent 82777f99
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ import subprocess
import traceback
import errno
import time
import pipes
import shlex
import socket
import shutil

@@ -508,7 +508,7 @@ def copyupdown_internal(wh, sd, upp):

    deststdout = devnull_read
    srcstdin = devnull_read
    remfileq = pipes.quote(sd[iremote])
    remfileq = shlex.quote(sd[iremote])
    if not dirsp:
        rune = 'cat %s%s' % ('><'[upp], remfileq)
        if upp:
+2 −2
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ import os
import sys
import errno
import time
import pipes
import shlex
import traceback
import re
import signal
@@ -129,7 +129,7 @@ class Testbed:

        # log command line invocation for the log
        adtlog.info('host %s; command line: %s' % (
            os.uname()[1], ' '.join([pipes.quote(w) for w in sys.argv])))
            os.uname()[1], ' '.join([shlex.quote(w) for w in sys.argv])))

        self.sp = subprocess.Popen(self.vserver_argv,
                                   stdin=subprocess.PIPE,
+2 −2
Original line number Diff line number Diff line
@@ -314,7 +314,7 @@ def make_auxverb(shared_dir):
    auxverb = os.path.join(workdir, 'runcmd')
    with open(auxverb, 'w') as f:
        f.write('''#!%(py)s
import sys, os, tempfile, threading, time, atexit, shutil, fcntl, errno, pipes
import sys, os, tempfile, threading, time, atexit, shutil, fcntl, errno, shlex
import socket

dir_host = '%(dir)s'
@@ -379,7 +379,7 @@ s.connect('%(tty)s')
cmd = 'PYTHONHASHSEED=0 /tmp/eofcat %%(d)s/stdin_eof %%(d)s/exit.tmp < %%(d)s/stdin | ' \\
      '(%%(c)s >> %%(d)s/stdout 2>> %%(d)s/stderr; echo $? > %%(d)s/exit.tmp);' \\
      'mv %%(d)s/exit.tmp %%(d)s/exit\\n' %% \\
       {'d': job_guest, 'c': ' '.join(map(pipes.quote, sys.argv[1:]))}
       {'d': job_guest, 'c': ' '.join(map(shlex.quote, sys.argv[1:]))}
s.send(cmd.encode())

# wait until command has exited
+2 −2
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ import os
import argparse
import tempfile
import shutil
import pipes
import shlex
import time
import subprocess
import socket
@@ -375,7 +375,7 @@ def can_sudo(ssh_cmd):
              '/bin/echo -e "#!/bin/sh\necho \'%s\'" > $F;' \
              'chmod u+x $F; sync; echo $F' % args.password
        askpass = VirtSubproc.check_exec(
            ssh_cmd + ['/bin/sh', '-ec', pipes.quote(cmd)],
            ssh_cmd + ['/bin/sh', '-ec', shlex.quote(cmd)],
            outp=True, timeout=30).strip()
        adtlog.debug('created SUDO_ASKPASS from specified password')
        cleanup_paths.append(askpass)