• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zopefoundation / zope.interface / 38692199648
99%

Build:
DEFAULT BRANCH: master
Ran 15 Oct 2026 06:28AM UTC
Jobs 1
Files 52
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

15 Oct 2026 06:24AM UTC coverage: 98.958% (+0.002%) from 98.956%
38692199648

push

github

web-flow
Fix a reference leak in the lazy declarations import (#389)

* Fix a reference leak in the lazy declarations import

_zic_state_load_declarations() (the heap-types path used on Python
3.11+) imports zope.interface.declarations and pulls a few attributes
off of it the first time something like getObjectSpecification()
needs them. Every early return on that path handed back NULL without
decrefing the declarations module or whichever attributes had already
been fetched, so a failure partway through the sequence leaked those
references.

This only happens if the import machinery itself misbehaves after the
module import already succeeded, which doesn't occur in normal use,
but it's still worth closing off. Switched both this function and its
static-types counterpart (import_declarations, used on Python < 3.11)
to a goto-based cleanup so every error path drops the references it
picked up.

Added a regression test that forces the lazy import to fail on a
throwaway instance of the extension module and checks the refcount of
the declarations module across the failed call.

* Fix reference leaks in lazy declarations import

- Fix import_declarations (Python < 3.11) to use local variables for
  attributes and clean them up on error via Py_XDECREF
- Extend test coverage for the Python 3.11+ heap-types path:
  - Verify module and attribute refcounts at different failure points
  - Verify state recovery on the same module instance after failure
- Remove _reset_imported_declarations (it leaked in production builds)
- Drop static-types test (Python < 3.11 has no test coverage)
- Remove unreachable SystemExit checks
- Remove double attribute restores
- Note: sharing _run_child helper with test_lookup_concurrency.py is deferred
- Note: free-threading race in _zic_state_load_declarations needs follow-up (see #391)

Part of copt: refcount leaks in declaration import and module init error
paths #363. Original PR: #389.
Assisted-by: Mistral-Vibe:mistral-large-2407

* Make... (continued)

992 of 1022 branches covered (97.06%)

Branch coverage included in aggregate %.

12205 of 12314 relevant lines covered (99.11%)

7.92 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
98.25
0.21% interface/tests/__init__.py
Jobs
ID Job ID Ran Files Coverage
1 38692199648.1 15 Oct 2026 06:28AM UTC 52
98.96
GitHub Action Run
Source Files on build 38692199648
  • Tree
  • List 52
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #38692199648
  • 15931e7f on github
  • Prev Build on master (#38544017858)
  • Next Build on master (#38692768618)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc