New submission from William Gianopoulos:

So, the arguments to run_process are not escaped when logged such that the 
logged command is un-parsable.
The following call:

self.run_process(['notify-send', '--app-name', 'Mozilla Build System', 'Mozilla 
Build System', msg])  where msg='Build complete'

ends up logging the following:

/usr/bin/notify-send --app-name Mozilla Build System Mozilla Build System Build 
complete

Where to be a valid command it needs to be:

/usr/bin/notify-send --app-name 'Mozilla Build System' 'Mozilla Build System' 
'Build complete'


So, I think this needs to either not log the command at all or for each 
parameter replace any occurrence of the character "'" with "\'" and then 
enclose the entire parameter with "'" to make sure the logged command can 
actually be properly parsed.

----------
components: Library (Lib)
messages: 284498
nosy: wgianopoulos
priority: normal
severity: normal
status: open
title: run_proces logs the command without escaping parmaeters such that the 
coammns logged are not valid
versions: Python 3.7

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

Reply via email to