[Idle-dev] use_subprocess issues...

Tony Lownds tony@lownds.com
Sun, 22 Sep 2002 18:25:55 -0700


--============_-1179378133==_ma============
Content-Type: text/plain; charset="us-ascii" ; format="flowed"

Kurt, the subprocess code has some strange behavior on Mac OS X. I'm 
working on it, in the meantime, let me know if I shouldn't commit a 
workaround.

The problem is that on Mac OS X os.spawnv([sys.executable, "-c", 
"command"]) does NOT start a plain vanilla python! Instead the main 
code (PyShell.py really) is called, and the "-c" "command" arguments 
are interpreted by PyShell.py

The workaround is to make your hardwired setting vary for the Mac OS 
X platform.

Thoughts?

-Tony

--- PyShell.py  18 Sep 2002 17:07:05 -0000      1.26
+++ PyShell.py  23 Sep 2002 01:12:53 -0000
@@ -28,8 +28,15 @@
  import rpc
  import RemoteDebugger

-# XX hardwire this for now, remove later  KBK 09Jun02
-use_subprocess = 1 # Set to 1 to spawn subprocess for command execution
+#
+# use_subprocess - if set, spawn subprocesses for command execution
+#
+use_subprocess = 1
+
+# The subprocess code needs to be handled in this file for Mac OS X - until
+# that change is made, don't use the new sub process code.
+if sys.platform == 'darwin' and sys.executable.count('.app'):
+  use_subprocess = 0

  # Change warnings module to write to sys.__stderr__
  try:
--============_-1179378133==_ma============
Content-Type: text/html; charset="us-ascii"

<!doctype html public "-//W3C//DTD W3 HTML//EN">
<html><head><style type="text/css"><!--
blockquote, dl, ul, ol, li { padding-top: 0 ; padding-bottom: 0 }
 --></style><title>use_subprocess issues...</title></head><body>
<div>Kurt, the subprocess code has some strange behavior on Mac OS X.
I'm working on it, in the meantime, let me know if I shouldn't commit
a workaround.</div>
<div><br></div>
<div>The problem is that on Mac OS X os.spawnv(<tt><font size="+1"
color="#000000">[sys.executable, &quot;-c&quot;,
&quot;command&quot;]</font></tt>) does NOT start a plain vanilla
python! Instead the main code (PyShell.py really) is called, and the
&quot;-c&quot; &quot;command&quot; arguments are interpreted by
PyShell.py</div>
<div><br></div>
<div>The workaround is to make your hardwired setting vary for the Mac
OS X platform.</div>
<div><br></div>
<div>Thoughts?</div>
<div><br></div>
<div>-Tony</div>
<div><br></div>
<div>--- PyShell.py&nbsp; 18 Sep 2002 17:07:05
-0000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.26<br>
+++ PyShell.py&nbsp; 23 Sep 2002 01:12:53 -0000<br>
@@ -28,8 +28,15 @@<br>
&nbsp;import rpc<br>
&nbsp;import RemoteDebugger<br>
&nbsp;<br>
-# XX hardwire this for now, remove later&nbsp; KBK 09Jun02<br>
-use_subprocess = 1 # Set to 1 to spawn subprocess for command
execution<br>
+#<br>
+# use_subprocess - if set, spawn subprocesses for command
execution<br>
+#<br>
+use_subprocess = 1<br>
+<br>
+# The subprocess code needs to be handled in this file for Mac OS X -
until<br>
+# that change is made, don't use the new sub process code.<br>
+if sys.platform == 'darwin' and sys.executable.count('.app'):<br>
+&nbsp; use_subprocess = 0<br>
&nbsp;<br>
&nbsp;# Change warnings module to write to sys.__stderr__<br>
&nbsp;try:</div>
</body>
</html>
--============_-1179378133==_ma============--