Skip to content

Don't emit 'Couldn't import C tracer' warning for 3.13t - #2203

Merged
nedbat merged 1 commit into
coveragepy:mainfrom
hugovk:nedbat/no-ctracer-warning-for-3.13t
Jun 22, 2026
Merged

nedbat merged 1 commit into
coveragepy:mainfrom
hugovk:nedbat/no-ctracer-warning-for-3.13t

Conversation

@hugovk

@hugovk hugovk commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

coverage.py 7.14.2 no longer has 3.13t wheels, and so falls back to the Python tracer and gives this warning:

coverage.exceptions.CoverageWarning: Couldn't import C tracer: No module named 'coverage.tracer' (no-ctracer); see https://coverage.readthedocs.io/en/7.14.2/messages.html#warning-no-ctracer

For example, https://github.com/prettytable/prettytable/actions/runs/27951172985/job/82708177859 with pytest config promoting warnings to errors.

The warning is only meant to be emitted when wheels are shipped, so update the constant.

However, we can't use the existing:

GIL = getattr(sys, "_is_gil_enabled", lambda: True)()

because it's possible for the GIL can be re-enabled in a free-threaded build, so check for a free-threaded build instead:

FREE_THREADED = bool(sysconfig.get_config_var("Py_GIL_DISABLED"))

@nedbat

nedbat commented Jun 22, 2026

Copy link
Copy Markdown
Member

I was trying to think of a way to test this, but the wheels are created late, and not in a place that has all the Python versions.

@nedbat
nedbat merged commit f36248d into coveragepy:main Jun 22, 2026
42 checks passed
nedbat added a commit that referenced this pull request Jun 22, 2026
@nedbat

nedbat commented Jun 22, 2026

Copy link
Copy Markdown
Member

This is now released as part of coverage 7.14.3.

@hugovk
hugovk deleted the nedbat/no-ctracer-warning-for-3.13t branch June 23, 2026 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants