[issue40363] shlex.quote applied to a glob pattern disables glob matching

2020-04-22 Thread Eric V. Smith
Eric V. Smith added the comment: I meant to add: it's possible that this isn't well documented. -- ___ Python tracker ___ ___ Pytho

[issue40363] shlex.quote applied to a glob pattern disables glob matching

2020-04-22 Thread Eric V. Smith
Eric V. Smith added the comment: Agreed that shlex.quote is working as intended. It's goal is to pass something to the shell, preserving it just as you started with it. It exists exactly because you want to avoid shell globbing and parsing issues (consider filenames that contain spaces and *

[issue40363] shlex.quote applied to a glob pattern disables glob matching

2020-04-22 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- type: -> behavior versions: +Python 3.9 -Python 3.7 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue40363] shlex.quote applied to a glob pattern disables glob matching

2020-04-22 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: shlex.quote makes the string safe to pass a command, what if it's rm 'var/log/syslog*' instead? You make sure that only the file given would be removed but then shlex.quote() shoot you in the foot. This would also cause issues for files with '*' or anothe

[issue40363] shlex.quote applied to a glob pattern disables glob matching

2020-04-22 Thread Jack Orenstein
New submission from Jack Orenstein : I am using shlex.quote to pass filenames to a shell command, e.g. ls. The problem is that glob patterns, when quoted, no longer operate as glob patterns. So, for example, executing this: ls 'var/log/syslog*' results in this output: ls: cannot acc