summaryrefslogtreecommitdiffstats
path: root/Lib/pipes.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/pipes.py')
-rw-r--r--Lib/pipes.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/pipes.py b/Lib/pipes.py
index 6a473ae..deab815 100644
--- a/Lib/pipes.py
+++ b/Lib/pipes.py
@@ -253,10 +253,13 @@ _safechars = string.ascii_letters + string.digits + '!@%_-+=:,./' # Safe unquote
_funnychars = '"`$\\' # Unsafe inside "double quotes"
def quote(file):
+ ''' return a shell-escaped version of the file string '''
for c in file:
if c not in _safechars:
break
else:
+ if not file:
+ return "''"
return file
if '\'' not in file:
return '\'' + file + '\''