New submission from Arfrever Frehtes Taifersar Arahesis: 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. ---------- components: Library (Lib) files: shlex_test.py messages: 171905 nosy: Arfrever, zmedico priority: normal severity: normal status: open title: shlex.shlex.error_leader() reports incorrect line number versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file27404/shlex_test.py _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue16121> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com