From b8d2d81d00108ee46529e1b0b5a7115a459f8a6a Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Sun, 4 Apr 2010 20:29:14 +0200 Subject: [PATCH] Really fix shell quoting, quoting single quotes correctly. --- patoolib/util.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/patoolib/util.py b/patoolib/util.py index e996e74..ae61514 100644 --- a/patoolib/util.py +++ b/patoolib/util.py @@ -270,8 +270,9 @@ def tmpfile (dir=None, prefix="temp", suffix=None): def shell_quote (value): - """Quote all shell metacharacters in given string value.""" - return "'%s'" % value.replace("'", r"\'") + """Quote all shell metacharacters in given string value with strong + (ie. single) quotes, handling the single quote especially.""" + return "'%s'" % value.replace("'", r"'\''") def stripext (filename):