Skip to content
Tcl Source Code View Ticket
Login

View Ticket

exec quoting problem (io.test fails if wd contains spaces)

Closed678400ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 23 years ago
Descriptionplain2003-01-31 21:27:40
Win2k and WinXP:

Attempting to run the regression test suite in a directory whose
path name contains whitespace results in test failures in
io-14.9 and io-29.32.

Test suite output is attached.
kennykbplain2003-02-01 04:28:20
File Added - 41192: io.errs
andreas_kupriesplain2003-02-25 07:04:04
File Added - 43361: io.test.diff-u

Logged In: YES 
user_id=75003

On linux I saw io-14.9 and io-48.3.
Enclosed a tentative patch. It solves the failures I saw, and I 
also did some changes which might solve 29.32. I am not 
sure. Please test.
andreas_kupriesplain2003-02-25 07:08:06
Logged In: YES 
user_id=75003

Hm, the 29.32 does not look like a whitespace problem. 
Permission denied. It doesn't happen if there is no 
whitespace in the path ?
kennykbplain2003-02-26 04:21:21
Logged In: YES 
user_id=99768

Andreas's patch fixes all but io-14.9, which appears 
to be a quoting problem in [exec]. Printing
the elements of [lindex $argv 0] in the child process
reveals:

cat = {C:/Documents
and = Settings/kennykb/My
Documents/SourceForge/tcl/win/cat} = longfile
{C:/Documents = and
Settings/kennykb/My = Documents/SourceForge/tcl/win/longfile}
script = {C:/Documents
and = Settings/kennykb/My
Documents/SourceForge/tcl/win/script} = test1
{C:/Documents = and
Settings/kennykb/My = Documents/SourceForge/tcl/win/test1}
test2 = {C:/Documents
and = Settings/kennykb/My
Documents/SourceForge/tcl/win/test2} = test3
{C:/Documents = and
Settings/kennykb/My = Documents/SourceForge/tcl/win/test3}
andreas_kupriesplain2003-02-26 05:14:35
Logged In: YES 
user_id=75003

Patch applied to CVS head.
andreas_kupriesplain2003-02-26 05:24:57
Logged In: YES 
user_id=75003

David, I remember that we have at least one other bug report 
about quoting issues with exec/windows. And this test failure 
sort of smells like this bug. Can you have a look.

The test uses 'array get/set' to transfer the contents of an 
array to a subprocess, as a single argument. But the space 
in the path messes this somehow up.
dgpplain2003-02-26 07:23:14
Logged In: YES 
user_id=80530

See Bugs 672938 and 554068
dgp Ticket [678400ffff]: 1 change [History diff]2003-10-03 04:49:20
davygrvyplain2003-10-03 05:35:52
File Added - 63254: tcl_bcl.txt

Logged In: YES 
user_id=7549

Here's a different XXX_BuildCommandLine() that I use in 
Expect-Win32.  Does this solve stuff?

BuildCommandLine() and the shell's setargv() must be 
complimentary.  But more importantly, BuildCommandLine() 
must follow the CreateProcess() quoting rules exactly so it 
works for all applications, not just our shell.
davygrvyplain2003-12-17 07:17:40
Logged In: YES 
user_id=7549

Working on a patch in https://sourceforge.net/tracker/?
func=detail&aid=672938&group_id=10894&atid=110894
davygrvyplain2004-02-01 16:36:12
Logged In: YES 
user_id=7549

My error, this is not related to TclpCreateProcess's argv 
handling.  Looks like pure script usage.

Is the test suite ok now?
kennykbplain2004-03-27 05:49:34
Logged In: YES 
user_id=99768

io.test now does not fail.
davygrvyplain2004-06-01 18:12:19
Logged In: YES 
user_id=7549

closing.
Log in (anonymous is fine) to add a comment.

Attachments: