There is one major problem with popen2.popen2() that I have found.
It takes different arguments on windows than what it does on unix.
The windows version expects a string, so I have applied the following patch
to get this working for ViewCVS on windows.
--- subversion/bindings/swig/python/svn/fs.py (revision 4614)
+++ subversion/bindings/swig/python/svn/fs.py (working copy)
@@ -19,6 +19,7 @@
### hide these names?
@@ -110,7 +111,10 @@
# open the pipe, forget the end for writing to the child (we won't),
# and then return the file object for reading from the child.
- fromchild, tochild = popen2.popen2(cmd)
+ if sys.platform[:3] == 'win':
+ fromchild, tochild = popen2.popen2(string.join(cmd))
+ fromchild, tochild = popen2.popen2(cmd)
----- Original Message -----
To: Greg Stein email@example.com
Cc: Michael Kefeder firstname.lastname@example.org; Subversion Developers
Sent: Monday, January 27, 2003 7:00 PM
Subject: Re: flaw in python bindings diff?
Greg Stein email@example.com writes:
Ah...looks like Greg Stein busted this when he converted to popen2 in
revision 4343 (strangely enough because he claimed it fixed diffs on
files with spaces in them). Greg, can you help out a bit here?
Switching to popen2 meant that I passed a filename as a separate
argument, which fixes the spaces. I forgot that a filename might be
part of those diffoptions.
Yes, passing a list as the diffoptions is the best behavior.
The reason to use popen2.popen2() is for security. The shell never
sees the command string; we just directly exec() the new process with
the right arguments. In the standard popen(), that goes to the shell
which can then parse for redirections and whatnot -- major security
All good. Your reasons for the change were fine, and understood, and
the fix for spaces has already been made. Yay!
To unsubscribe, e-mail: firstname.lastname@example.org
For additional commands, e-mail: email@example.com
Received on Sat Oct 14 02:21:05 2006