Author Arfrever
Recipients Arfrever, zmedico
Date 2012-10-03.20:10:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1349295018.27.0.805550020258.issue16121@psf.upfronthosting.co.za>
In-reply-to
Content
shlex.shlex.error_leader() reports incorrect line number with posix=True or when last token is not quoted.
This bug occurs in all versions of Python.

The attached script shows this bug:
$ ./shlex_test.py
### text1 posix=False
('var1', '"None", line 1: ')
('=', '"None", line 1: ')
('"x"', '"None", line 1: ')
('var2', '"None", line 2: ')
('=', '"None", line 2: ')
('"y"', '"None", line 2: ')
('var3', '"None", line 3: ')
('=', '"None", line 3: ')
('"z"', '"None", line 3: ')
### text1 posix=True
('var1', '"None", line 1: ')
('=', '"None", line 1: ')
('x', '"None", line 2: ')
('var2', '"None", line 2: ')
('=', '"None", line 2: ')
('y', '"None", line 3: ')
('var3', '"None", line 3: ')
('=', '"None", line 3: ')
('z', '"None", line 3: ')
### text2 posix=False
('var1', '"None", line 1: ')
('=', '"None", line 1: ')
('x', '"None", line 2: ')
('var2', '"None", line 2: ')
('=', '"None", line 2: ')
('y', '"None", line 3: ')
('var3', '"None", line 3: ')
('=', '"None", line 3: ')
('z', '"None", line 3: ')
### text2 posix=True
('var1', '"None", line 1: ')
('=', '"None", line 1: ')
('x', '"None", line 2: ')
('var2', '"None", line 2: ')
('=', '"None", line 2: ')
('y', '"None", line 3: ')
('var3', '"None", line 3: ')
('=', '"None", line 3: ')
('z', '"None", line 3: ')
### text3 posix=False
('"x"', '"None", line 1: ')
('"y"', '"None", line 2: ')
('"z"', '"None", line 3: ')
### text3 posix=True
('x', '"None", line 2: ')
('y', '"None", line 3: ')
('z', '"None", line 3: ')
### text4 posix=False
('x', '"None", line 2: ')
('y', '"None", line 3: ')
('z', '"None", line 3: ')
### text4 posix=True
('x', '"None", line 2: ')
('y', '"None", line 3: ')
('z', '"None", line 3: ')

Only "text1 posix=False" and "text3 posix=False" have all correct line numbers.
History
Date User Action Args
2012-10-03 20:10:18Arfreversetrecipients: + Arfrever, zmedico
2012-10-03 20:10:18Arfreversetmessageid: <1349295018.27.0.805550020258.issue16121@psf.upfronthosting.co.za>
2012-10-03 20:10:18Arfreverlinkissue16121 messages
2012-10-03 20:10:17Arfrevercreate