Skip to content

coverage run fails with a re.error with Python 3.9a6+ #988

Closed
@pquentin

Description

@pquentin

coverage run fails with a re.error in Python nightly

To Reproduce

  1. Python version: 3.9.0a6+ (heads/master:85bdec1, May 10 2020, 05:50:51)
  2. coverage 5.1
  3. This failed in the CI build of urllib3 (https://github.com/urllib3/urllib3/blob/master/.travis.yml) which runs nox -s test-3.9
  4. coverage run --parallel-mode -m pytest -r a --tb=native --no-success-flaky-report test/

Sorry, I did not try this outside of a failing CI job: https://travis-ci.org/github/urllib3/urllib3/jobs/685596004

By comparing the last known good build, I can tell that the problem has been introduced in one of those commits: python/cpython@f01d1be...85bdec1

Expected behavior

I would expect the tests to run.

Additional context

Instead, I get the following traceback:

Traceback (most recent call last):
  File "/home/travis/build/urllib3/urllib3/.nox/test-3-9/bin/coverage", line 8, in <module>
    sys.exit(main())
  File "/home/travis/build/urllib3/urllib3/.nox/test-3-9/lib/python3.9/site-packages/coverage/cmdline.py", line 827, in main
    status = CoverageScript().command_line(argv)
  File "/home/travis/build/urllib3/urllib3/.nox/test-3-9/lib/python3.9/site-packages/coverage/cmdline.py", line 555, in command_line
    return self.do_run(options, args)
  File "/home/travis/build/urllib3/urllib3/.nox/test-3-9/lib/python3.9/site-packages/coverage/cmdline.py", line 700, in do_run
    self.coverage.start()
  File "/home/travis/build/urllib3/urllib3/.nox/test-3-9/lib/python3.9/site-packages/coverage/control.py", line 525, in start
    self._init_for_start()
  File "/home/travis/build/urllib3/urllib3/.nox/test-3-9/lib/python3.9/site-packages/coverage/control.py", line 487, in _init_for_start
    self._inorout.configure(self.config)
  File "/home/travis/build/urllib3/urllib3/.nox/test-3-9/lib/python3.9/site-packages/coverage/inorout.py", line 192, in configure
    self.omit_match = FnmatchMatcher(self.omit)
  File "/home/travis/build/urllib3/urllib3/.nox/test-3-9/lib/python3.9/site-packages/coverage/files.py", line 273, in __init__
    self.re = fnmatches_to_regex(self.pats, case_insensitive=env.WINDOWS)
  File "/home/travis/build/urllib3/urllib3/.nox/test-3-9/li/python3.9/site-packages/coverage/files.py", line 325, in fnmatches_to_regex
    compiled = re.compile(join_regex(regexes), flags=flags)
  File "/opt/python/3.9-dev/lib/python3.9/re.py", line 252, in compile
    return _compile(pattern, flags)
  File "/opt/python/3.9-dev/lib/python3.9/re.py", line 304, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/opt/python/3.9-dev/lib/python3.9/sre_compile.py", line 764, in compile
    p = sre_parse.parse(p, flags)
  File "/opt/python/3.9-dev/lib/python3.9/sre_parse.py", line 948, in parse
    p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
  File "/opt/python/3.9-dev/lib/python3.9/sre_parse.py", line 443, in _parse_sub
    itemsappend(_parse(source, state, verbose, nested + 1,
  File "/opt/python/3.9-dev/lib/python3.9/sre_parse.py", line 834, in _parse
    p = _parse_sub(source, state, sub_verbose, nested + 1)
  File "/opt/python/3.9-dev/lib/python3.9/sre_parse.py", line 443, in _parse_sub
    itemsappend(_parse(source, state, verbose, nested + 1,
  File "/opt/python/3.9-dev/lib/python3.9/sre_parse.py", line 834, in _parse
    p = _parse_sub(source, state, sub_verbose, nested + 1)
  File "/opt/python/3.9-dev/lib/python3.9/sre_parse.py", line 443, in _parse_sub
    itemsappend(_parse(source, state, verbose, nested + 1,
  File "/opt/python/3.9-dev/lib/python3.9/sre_parse.py", line 754, in _parse
    p = _parse_sub(source, state, verbose, nested + 1)
  File "/opt/python/3.9-dev/lib/python3.9/sre_parse.py", line 443, in _parse_sub
    itemsappend(_parse(source, state, verbose, nested + 1,
  File "/opt/python/3.9-dev/lib/python3.9/sre_parse.py", line 831, in _parse
    raise source.error(err.msg, len(name) + 1) from None
re.error: redefinition of group name 'g1' as group 2; was group 1 at position 284

Since the traceback is fully in coverage.py, I expect that the details about urllib3 are irrelevant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingnot our bugThe problem was elsewhere

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions