close
Skip to content

crash in entry_points() when console script name includes a colon #75

Description

@jaraco

In GitLab by @gooseyard on Jul 12, 2019, 14:59

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions