[issue10322] sys.argv and quoted arguments on command line

2010-11-05 Thread Rügheimer

New submission from Rügheimer :

Words in quoted command line arguments containing whitespace are split into 
separate entries of the argument vector sys.argv. This implemetation (quote 
removal + word splitting) removes information required to read string arguments 
passed via the command line.

The expected behaviour would be to unquote the argument, but not to conduct 
word splitting within the quoted text.


Test program output:

> ./argtest arg1 arg2 "this should be a single argument"
  
  ['./argtest', 'arg1', 'arg2', 'this', 'should', 'be', 'a', 'single', 
'argument']


(observed with Python 3.1.2 (r312:79147, Oct 28 2010, 14:12:33)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2

--
components: None
files: argtest
messages: 120480
nosy: fcr
priority: normal
severity: normal
status: open
title: sys.argv and quoted arguments on command line
type: behavior
versions: Python 2.5, Python 3.1
Added file: http://bugs.python.org/file19503/argtest

___
Python tracker 
<http://bugs.python.org/issue10322>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10322] sys.argv and quoted arguments on command line

2010-11-05 Thread Rügheimer

Rügheimer  added the comment:

2.6.18-194.17.1.el5 #1 SMP Wed Sep 29 12:51:33 EDT 2010 i686 i686 i386 GNU/Linux

GNU bash, version 3.2.25(1)-release (i686-redhat-linux-gnu)

I wrote test program in C to do the same thing as before and the arguments are 
treated properly:

> ./testcargs arg1 arg2 "this should be one arg"
argument 0 is:./testcargs
argument 1 is:arg1
argument 2 is:arg2
argument 3 is:this should be one arg

My suspicion is that sys implementation goes into a branch intended for a 
different OS.

--

___
Python tracker 
<http://bugs.python.org/issue10322>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10322] sys.argv and quoted arguments on command line

2010-11-05 Thread Frank Rügheimer

Frank Rügheimer  added the comment:

You are right, it seems to work when the file is passed directly into python so 
the quotes are stripped somewhere before python even gets to see them. 

Thanks

--
status: open -> closed

___
Python tracker 
<http://bugs.python.org/issue10322>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com