``ValueError`` when mapping value contains a literal ``=``.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PBR |
Fix Released
|
Undecided
|
Herve Beraud |
Bug Description
In Setup.cfg when a value contains a literal ``=`` the parsor is not able to correctly exploid the value since other occurrence of ``=`` can be founds (cf. following example).
Example ``setup.cfg``:
project_urls = Documentation = https:/
Current result:
$ ./setup.py
ERROR:root:Error parsing
Traceback (most recent call last):
File "/usr/local/
File "/usr/local/
File "/usr/local/
ValueError: too many values to unpack (expected 2)
error in setup command: Error parsing /Users/
Changed in pbr: | |
assignee: | nobody → Herve Beraud (herveberaud) |
Changed in pbr: | |
status: | New → In Progress |
Reviewed: https:/ /review. openstack. org/625372 /git.openstack. org/cgit/ openstack- dev/pbr/ commit/ ?id=e28fc7e8702 826a5325db35472 a51fec5068aff7
Committed: https:/
Submitter: Zuul
Branch: master
commit e28fc7e8702826a 5325db35472a51f ec5068aff7
Author: Brandon LeBlanc <email address hidden>
Date: Fri Dec 14 16:13:55 2018 -0600
Resolve ``ValueError`` when mapping value contains a literal ``=``.
Example ``setup.cfg``::
Current result::
$ ./setup.py
ERROR: root:Error parsing lib/python3. 7/site- packages/ pbr/core. py", line 96, in pbr to_args( path, dist.script_args) lib/python3. 7/site- packages/ pbr/util. py", line 258, in cfg_to_args to_setup_ kwargs( config, script_args) lib/python3. 7/site- packages/ pbr/util. py", line 336, in setup_cfg_ to_setup_ kwargs brandon/ src/format- pipfile/ setup.cfg: ValueError: too many values to unpack (expected 2)
Traceback (most recent call last):
File "/usr/local/
attrs = util.cfg_
File "/usr/local/
kwargs = setup_cfg_
File "/usr/local/
k, v = i.split(=)
ValueError: too many values to unpack (expected 2)
error in setup command: Error parsing /Users/
After changes::
$ ./setup.py egg_info
Project- URL: Documentation, https:/ /format- pipfile. readthedocs. io/en/latest/ ?badge= latest
[...]
$ grep -i project-url *.egg-info/PKG-INFO
[...]
[...]
add unit tests
{1} pbr.tests. test_util. TestMapFieldsPa rsingScenarios. test_project_ url_parsing( simple_ project_ urls) [0.034230s] ... ok test_util. TestMapFieldsPa rsingScenarios. test_project_ url_parsing( query_parameter s) [0.029791s] ... ok
{1} pbr.tests.
Closes-Bug: #1817592 9dadee77d6aabed 201d9e84bdb
Change-Id: Ifd4c46111528d9
Signed-off-by: Brandon LeBlanc <email address hidden>