From 2c1cde0f596fa27fcde00d2f351ee9c439655125 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 13 Aug 2015 17:21:36 +0200 Subject: [PATCH] Minor fix (reported over ML - ignore saving of conf.saveCmdline) --- lib/core/option.py | 4 ++++ lib/core/settings.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/lib/core/option.py b/lib/core/option.py index fd2170c14..52ffeeb46 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -107,6 +107,7 @@ from lib.core.settings import DEFAULT_PAGE_ENCODING from lib.core.settings import DEFAULT_TOR_HTTP_PORTS from lib.core.settings import DEFAULT_TOR_SOCKS_PORT from lib.core.settings import DUMMY_URL +from lib.core.settings import IGNORE_SAVE_OPTIONS from lib.core.settings import INJECT_HERE_MARK from lib.core.settings import IS_WIN from lib.core.settings import KB_CHARS_BOUNDARY_CHAR @@ -1995,6 +1996,9 @@ def _saveCmdline(): if datatype and isListLike(datatype): datatype = datatype[0] + if option in IGNORE_SAVE_OPTIONS: + value = None + if value is None: if datatype == OPTION_TYPE.BOOLEAN: value = "False" diff --git a/lib/core/settings.py b/lib/core/settings.py index 325855514..d92e443d4 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -386,6 +386,9 @@ CODECS_LIST_PAGE = "http://docs.python.org/library/codecs.html#standard-encoding # Simple regular expression used to distinguish scalar from multiple-row commands (not sole condition) SQL_SCALAR_REGEX = r"\A(SELECT(?!\s+DISTINCT\(?))?\s*\w*\(" +# Option/switch values to ignore during configuration save +IGNORE_SAVE_OPTIONS = ("saveCmdline",) + # IP address of the localhost LOCALHOST = "127.0.0.1"