From c986b64baf908471675701eaf265c1ef69922397 Mon Sep 17 00:00:00 2001 From: Guillaume Horel Date: Tue, 12 Jan 2016 17:16:52 -0500 Subject: [PATCH] fix space in filename --- gnupg/_parsers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gnupg/_parsers.py b/gnupg/_parsers.py index 9de57d2..c4c3074 100644 --- a/gnupg/_parsers.py +++ b/gnupg/_parsers.py @@ -30,6 +30,7 @@ from ordereddict import OrderedDict import re +import shlex from . import _util from ._util import log @@ -306,7 +307,7 @@ def _check_option(arg, value): checked += (flag + ' ') if _is_string(value): - values = value.split(' ') + values = shlex.split(value) for v in values: ## these can be handled separately, without _fix_unsafe(), ## because they are only allowed if they pass the regex @@ -372,7 +373,7 @@ def _check_option(arg, value): is_flag = lambda x: x.startswith('--') def _make_filo(args_string): - filo = arg.split(' ') + filo = re.findall(r'(?:[^\s,"]|"(?:\\.|[^"])*")+', args_string) filo.reverse() log.debug("_make_filo(): Converted to reverse list: %s" % filo) return filo