diff options
author | Brandon LeBlanc <brandon@leblanc.codes> | 2018-12-14 16:13:55 -0600 |
---|---|---|
committer | Hervé Beraud <hberaud@redhat.com> | 2019-02-25 17:09:55 +0100 |
commit | e28fc7e8702826a5325db35472a51fec5068aff7 (patch) | |
tree | a7fd5d6442fd9ce9ac17fcdab4b925501ac347c2 /releasenotes/notes | |
parent | 11cf070f9412363ba3cec9e746b34d06c6f73a0b (diff) | |
download | pbr-e28fc7e8702826a5325db35472a51fec5068aff7.tar.gz |
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 <brandon@leblanc.codes>
Diffstat (limited to 'releasenotes/notes')
-rw-r--r-- | releasenotes/notes/fix-mapping-value-explode-with-equal-sign-41bf822fa4dd0e68.yaml | 7 |
1 files changed, 7 insertions, 0 deletions
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 |