From e28fc7e8702826a5325db35472a51fec5068aff7 Mon Sep 17 00:00:00 2001 From: Brandon LeBlanc Date: Fri, 14 Dec 2018 16:13:55 -0600 Subject: Resolve ``ValueError`` when mapping value contains a literal ``=``. Example ``setup.cfg``:: project_urls = Documentation = https://format-pipfile.readthedocs.io/en/latest/?badge=latest Current result:: $ ./setup.py ERROR:root:Error parsing Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/pbr/core.py", line 96, in pbr attrs = util.cfg_to_args(path, dist.script_args) File "/usr/local/lib/python3.7/site-packages/pbr/util.py", line 258, in cfg_to_args kwargs = setup_cfg_to_setup_kwargs(config, script_args) File "/usr/local/lib/python3.7/site-packages/pbr/util.py", line 336, in setup_cfg_to_setup_kwargs k, v = i.split(=) ValueError: too many values to unpack (expected 2) error in setup command: Error parsing /Users/brandon/src/format-pipfile/setup.cfg: ValueError: too many values to unpack (expected 2) After changes:: $ ./setup.py egg_info [...] $ grep -i project-url *.egg-info/PKG-INFO [...] Project-URL: Documentation, https://format-pipfile.readthedocs.io/en/latest/?badge=latest [...] add unit tests {1} pbr.tests.test_util.TestMapFieldsParsingScenarios.test_project_url_parsing(simple_project_urls) [0.034230s] ... ok {1} pbr.tests.test_util.TestMapFieldsParsingScenarios.test_project_url_parsing(query_parameters) [0.029791s] ... ok Closes-Bug: #1817592 Change-Id: Ifd4c46111528d99dadee77d6aabed201d9e84bdb Signed-off-by: Brandon LeBlanc --- ...fix-mapping-value-explode-with-equal-sign-41bf822fa4dd0e68.yaml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 releasenotes/notes/fix-mapping-value-explode-with-equal-sign-41bf822fa4dd0e68.yaml (limited to 'releasenotes') diff --git a/releasenotes/notes/fix-mapping-value-explode-with-equal-sign-41bf822fa4dd0e68.yaml b/releasenotes/notes/fix-mapping-value-explode-with-equal-sign-41bf822fa4dd0e68.yaml new file mode 100644 index 0000000..3898587 --- /dev/null +++ b/releasenotes/notes/fix-mapping-value-explode-with-equal-sign-41bf822fa4dd0e68.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + Fix mapping error on values who contains a literal ``=``. Example when + setup.cfg contains content like the following project urls configuration + "project_urls = Documentation = http://foo.bar/?badge=latest". + https://bugs.launchpad.net/pbr/+bug/1817592 -- cgit v1.2.1