summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Turner <jturner.usa@gmail.com>2025-09-18 05:48:59 -0400
committerJohn Turner <jturner.usa@gmail.com>2025-09-18 05:49:16 -0400
commit1458c9012354da71426d0848c022cbc6644cc1db (patch)
tree499606ce47732fb9a6ad9e64b1cddf6b76a8ce35
parenta3d35b6318332577ef8aa2699e27c0c52cdeeb3a (diff)
downloadpypaste-1458c9012354da71426d0848c022cbc6644cc1db.tar.gz
pass --command directly into subprocess.run using shell=True
-rw-r--r--pypaste/client/__main__.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/pypaste/client/__main__.py b/pypaste/client/__main__.py
index fabf50c..7a86445 100644
--- a/pypaste/client/__main__.py
+++ b/pypaste/client/__main__.py
@@ -1,7 +1,6 @@
import sys
import pkgutil
import subprocess
-import shlex
import pypaste.client.plugins as plugins
from importlib import import_module
from argparse import ArgumentParser
@@ -77,8 +76,13 @@ def main() -> int:
except Exception as e:
print(f"failed to read {file}: {e}")
elif (command := args.command) is not None:
- cmd = shlex.split(command, posix=True)
- proc = subprocess.run(cmd, capture_output=True, text=True, shell=True)
+ proc = subprocess.run(
+ command,
+ text=True,
+ shell=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT,
+ )
if proc.returncode != 0:
print(