# HG changeset patch # User Goffi # Date 1565968003 -7200 # Node ID 98d1f34ce5b94586781643cd0c473fe4284f62cb # Parent e80694d536d7cd7ded2f40fdc9e55494ea718703 tools (config), memory: renamed SafeConfigParser following Python 3 port diff -r e80694d536d7 -r 98d1f34ce5b9 sat/memory/memory.py --- a/sat/memory/memory.py Fri Aug 16 14:14:19 2019 +0200 +++ b/sat/memory/memory.py Fri Aug 16 17:06:43 2019 +0200 @@ -26,7 +26,7 @@ import os.path import copy from collections import namedtuple -from configparser import SafeConfigParser, NoOptionError, NoSectionError +from configparser import ConfigParser, NoOptionError, NoSectionError from uuid import uuid4 from twisted.python import failure from twisted.internet import defer, reactor, error @@ -229,7 +229,7 @@ @param silent (boolean): toggle logging output (must be True when called from sat.sh) """ - user_config = SafeConfigParser() + user_config = ConfigParser() try: user_config.read(C.CONFIG_FILES) except: diff -r e80694d536d7 -r 98d1f34ce5b9 sat/tools/config.py --- a/sat/tools/config.py Fri Aug 16 14:14:19 2019 +0200 +++ b/sat/tools/config.py Fri Aug 16 17:06:43 2019 +0200 @@ -23,7 +23,7 @@ import os import csv import json -from configparser import SafeConfigParser, DEFAULTSECT, NoOptionError, NoSectionError +from configparser import ConfigParser, DEFAULTSECT, NoOptionError, NoSectionError from xdg import BaseDirectory from sat.core.log import getLogger from sat.core.constants import Const as C @@ -42,7 +42,7 @@ @param value (str): the new value @param silent (boolean): toggle logging output (must be True when called from sat.sh) """ - config = SafeConfigParser() + config = ConfigParser() target_file = None for file_ in C.CONFIG_FILES[::-1]: # we will eventually update the existing file with the highest priority, @@ -72,7 +72,7 @@ def parseMainConf(): """look for main .ini configuration file, and parse it""" - config = SafeConfigParser(defaults=C.DEFAULT_CONFIG) + config = ConfigParser(defaults=C.DEFAULT_CONFIG) try: config.read(C.CONFIG_FILES) except Exception as e: @@ -83,7 +83,7 @@ def getConfig(config, section, name, default=None): """Get a configuration option - @param config (SafeConfigParser): the configuration instance + @param config (ConfigParser): the configuration instance @param section (str): section of the config file (None or '' for DEFAULT) @param name (str): name of the option @param default: value to use if not found, or Exception to raise an exception