[Patches] [ python-Patches-1535504 ] CGIHTTPServer doesn't handle path names with embeded space

SourceForge.net noreply at sourceforge.net
Thu Mar 15 08:48:39 CET 2007


Patches item #1535504, was opened at 2006-08-06 19:43
Message generated for change (Comment added) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1535504&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Hartmut Goebel (htgoebel)
Assigned to: Nobody/Anonymous (nobody)
Summary: CGIHTTPServer doesn't handle path names with embeded space

Initial Comment:
This is a patch for Bug #1436206:

On Windows, if the path name of a CGI script to be run
contains space characters, it need to be quoted
properly when called via os.popen2/3. Otherwise the
script can not be executed.

Solved by using commands.mkarg() to quote arguments
where necessary.


----------------------------------------------------------------------

>Comment By: Georg Brandl (gbrandl)
Date: 2007-03-15 07:48

Message:
Logged In: YES 
user_id=849994
Originator: NO

Which error is that? Is it perhaps this: http://python.org/sf/1124861 ?

----------------------------------------------------------------------

Comment By: Hartmut Goebel (htgoebel)
Date: 2007-03-14 21:22

Message:
Logged In: YES 
user_id=376953
Originator: YES

I think the best way to solve this would be to use the
subprocess module, as amk suggested.

I included a new patch which for CGIHTTPServer which uses subprocess.
Unfortunately 
this does not work ion Windows due to a problem with subprocess: On
Windows 
passing the request.rfile (a _fileobject wrapper arround the socket) as
stdin/out
lead to an error. I'll file a bugreport on that case.

Beside of this, the patch should solve the problem in a
platform-independent way.
File Added: CGIHTTPServer.patch

----------------------------------------------------------------------

Comment By: Georg Brandl (gbrandl)
Date: 2007-03-13 19:36

Message:
Logged In: YES 
user_id=849994
Originator: NO

Note that commands.mkarg() is written for UNIX shells. While it may work
with spaces in the file name, it may produce illegal Windows command line
commands in other cases.

----------------------------------------------------------------------

Comment By: A.M. Kuchling (akuchling)
Date: 2006-10-27 17:54

Message:
Logged In: YES 
user_id=11375

Would it simplify matters if CGIHTTPServer used the
subprocess module, which tries to provide a
platform-independent interface?


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1535504&group_id=5470


More information about the Patches mailing list