Fixed an issue in the multi process debugger causing a corrupted command line for an external non-Python program (e.g. if call via subprocess.Popen) (see issue466). eric7

Tue, 06 Dec 2022 14:06:42 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 06 Dec 2022 14:06:42 +0100
branch
eric7
changeset 9571
0e2ab682dfa3
parent 9570
481cc0d3699d
child 9572
3b46c662a004

Fixed an issue in the multi process debugger causing a corrupted command line for an external non-Python program (e.g. if call via subprocess.Popen) (see issue466).

src/eric7/DebugClients/Python/DebugUtilities.py file | annotate | diff | comparison | revisions
src/eric7/DebugClients/Python/MultiProcessDebugExtension.py file | annotate | diff | comparison | revisions
--- a/src/eric7/DebugClients/Python/DebugUtilities.py	Tue Dec 06 11:24:53 2022 +0100
+++ b/src/eric7/DebugClients/Python/DebugUtilities.py	Tue Dec 06 14:06:42 2022 +0100
@@ -295,6 +295,10 @@
     @return modified argument list
     @rtype list of str
     """
+    if not isPythonProgram(arguments[0]):
+        # it is not a Python program
+        return arguments
+
     debugClientScript = os.path.join(os.path.dirname(__file__), "DebugClient.py")
     if debugClientScript in arguments:
         # it is already patched
--- a/src/eric7/DebugClients/Python/MultiProcessDebugExtension.py	Tue Dec 06 11:24:53 2022 +0100
+++ b/src/eric7/DebugClients/Python/MultiProcessDebugExtension.py	Tue Dec 06 14:06:42 2022 +0100
@@ -72,8 +72,8 @@
         Function replacing the 'execl' functions of the os module.
         """
         if _shallPatch():
-            args = patchArguments(_debugClient, args)
             if isPythonProgram(args[0]):
+                args = patchArguments(_debugClient, args)
                 path = args[0]
         return getattr(os, originalName)(path, *args)
 
@@ -100,8 +100,8 @@
         Function replacing the 'execv' functions of the os module.
         """
         if _shallPatch():
-            args = patchArguments(_debugClient, args)
             if isPythonProgram(args[0]):
+                args = patchArguments(_debugClient, args)
                 path = args[0]
         return getattr(os, originalName)(path, args)
 
@@ -128,8 +128,8 @@
         Function replacing the 'execve' functions of the os module.
         """
         if _shallPatch():
-            args = patchArguments(_debugClient, args)
             if isPythonProgram(args[0]):
+                args = patchArguments(_debugClient, args)
                 path = args[0]
         return getattr(os, originalName)(path, args, env)
 

eric ide

mercurial