mirror of
https://github.com/rpm-software-management/tito.git
synced 2025-02-23 12:12:47 +00:00
avoid TB on python3 due to git format string
Use RawConfigParser instead of ConfigParser to avoid... Traceback (most recent call last): File "/home/sandbox/test/functional/multiproject_tests.py", line 68, in setUp self.create_project(TEST_PKG_1, os.path.join(self.repo_dir, 'pkg1')) File "/home/sandbox/test/functional/fixture.py", line 198, in create_project tito('tag --keep-version --debug --accept-auto-changelog') File "/home/sandbox/test/functional/fixture.py", line 103, in tito return CLI().main(argstring.split(' ')) File "/home/sandbox/src/tito/cli.py", line 222, in main return module.main(argv) File "/home/sandbox/src/tito/cli.py", line 671, in main offline=self.options.offline) File "/home/sandbox/src/tito/tagger/main.py", line 51, in __init__ ConfigObject.__init__(self, config=config) File "/home/sandbox/src/tito/config_object.py", line 38, in __init__ config.get(section, options)) File "/usr/lib64/python3.3/configparser.py", line 1184, in set super().set(section, option, value) File "/usr/lib64/python3.3/configparser.py", line 889, in set value) File "/usr/lib64/python3.3/configparser.py", line 399, in before_set "position %d" % (value, tmp_value.find('%'))) nose.proxy.ValueError: ValueError: invalid interpolation syntax in '%s (%ae)' at position 0
This commit is contained in:
parent
172d67794e
commit
a398833e72
3 changed files with 3 additions and 5 deletions
|
@ -90,7 +90,7 @@ class ConfigLoader(object):
|
|||
# Load the global config. Later, when we know what tag/package we're
|
||||
# building, we may also load that and potentially override some global
|
||||
# settings.
|
||||
config = ConfigParser()
|
||||
config = RawConfigParser()
|
||||
config.read(filename)
|
||||
|
||||
self._check_legacy_globalconfig(config)
|
||||
|
@ -492,7 +492,7 @@ class ReleaseModule(BaseCliModule):
|
|||
"""
|
||||
rel_eng_dir = os.path.join(find_git_root(), "rel-eng")
|
||||
filename = os.path.join(rel_eng_dir, RELEASERS_CONF_FILENAME)
|
||||
config = ConfigParser()
|
||||
config = RawConfigParser()
|
||||
config.read(filename)
|
||||
return config
|
||||
|
||||
|
|
|
@ -19,13 +19,11 @@ ENCODING = sys.getdefaultencoding()
|
|||
PY2 = sys.version_info[0] == 2
|
||||
if PY2:
|
||||
import commands
|
||||
from ConfigParser import ConfigParser
|
||||
from ConfigParser import NoOptionError
|
||||
from ConfigParser import RawConfigParser
|
||||
from StringIO import StringIO
|
||||
else:
|
||||
import subprocess
|
||||
from configparser import ConfigParser
|
||||
from configparser import NoOptionError
|
||||
from configparser import RawConfigParser
|
||||
from io import StringIO
|
||||
|
|
|
@ -12,7 +12,7 @@ class BuildTargetParserTests(unittest.TestCase):
|
|||
self.valid_branches = ["branch1", "branch2"]
|
||||
|
||||
self.release_target = "project-x.y.z"
|
||||
self.releasers_config = ConfigParser()
|
||||
self.releasers_config = RawConfigParser()
|
||||
self.releasers_config.add_section(self.release_target)
|
||||
self.releasers_config.set(self.release_target, "build_targets",
|
||||
"branch1:project-x.y.z-candidate")
|
||||
|
|
Loading…
Add table
Reference in a new issue