crash in entry_points() when console script name includes a colon
I have a proprietary module which includes a few console scripts having colons in the name, e.g:
entry_points={ 'console_scripts': [ 'script:xy=mymodule.scripts.script:main', ...
I noticed that pytest began to fail after adding the new scripts, and traced it to importlib_metadata.
File "/home/bailey/bart_rest_api/venv/lib/python3.7/site-packages/importlib_metadata/__init__.py", line 113, in _from_text
config.read_string(text)
File "/usr/lib/akamai-portable-python/lib/python3.7/configparser.py", line 722, in read_string
self.read_file(sfile, source)
File "/usr/lib/akamai-portable-python/lib/python3.7/configparser.py", line 717, in read_file
self._read(f, source)
File "/usr/lib/akamai-portable-python/lib/python3.7/configparser.py", line 1091, in _read
fpname, lineno)
configparser.DuplicateOptionError: While reading from '<string>' [line 44]: option 'script' in section 'console_scripts' already exists
I was able to resolve the problem by adjusting the construction of the config object in _from_text to:
config = ConfigParser(delimiters=('='), strict=False)
although I suspect there are other implications of changing that setting.