New submission from timonegk <pyt...@timonengelke.de>:

Steps to reproduce:
>>> from shlex import split
>>> line = "export F=$'\\''"
>>> split(line)
ValueError: No closing quotation

However, when printing the line

>>> print(line)
export F=$'\''

and pasting the output in bash, no further quotation marks are required.
The behavior of bash is described in its man page (line 497 for me, Chapter 
Quoting) and occurs also when bash is called with --posix. Therefore I guess 
that shlex does not reproduce the posix behavior here.

----------
components: Library (Lib)
messages: 355265
nosy: timonegk
priority: normal
severity: normal
status: open
title: Shlex does not parse commands containing single quotes correctly
type: behavior
versions: Python 2.7, Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38570>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to