← 返回首页
test_bdb is sensitive to sys.meta_path manipulation · Issue #93951 · python/cpython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

test_bdb is sensitive to sys.meta_path manipulation #93951

New issue
New issue

Description

Here's a repro not involving Setuptools showing how test_bdb is sensitive to sys.meta_path manipulation:

FROM jaraco/multipy-tox RUN apt install -y libarchive-tools RUN apt install -y build-essential gdb lcov pkg-config libbz2-dev libffi-dev libgdbm-dev libgdbm-compat-dev liblzma-dev libncurses5-dev libreadline6-dev libsqlite3-dev libssl-dev lzma lzma-dev tk-dev uuid-dev zlib1g-dev RUN wget -O - https://github.com/python/cpython/archive/refs/heads/3.9.zip | bsdtar -xf - WORKDIR cpython-3.9 RUN sh ./configure --prefix /opt/python RUN make install WORKDIR / RUN /opt/python/bin/python3 -m pip install --upgrade pip RUN /opt/python/bin/python3 -m pip uninstall -y setuptools RUN echo "import sys; sys.meta_path.insert(0, type('NullFinder', (), dict(find_spec=lambda *args: None))())" > /opt/python/lib/python3.9/site-packages/null-finder.pth CMD /opt/python/bin/python3 -m test_bdb

It fails with a similar error:

AssertionError: Wrong event type at expect_set item 2, got 'call' Expected: ('line', 3, 'tfunc_import') Got: ('call', 1, '<lambda>'), ('quit',),

Originally posted by @jaraco in #91169 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    • Open in GitHub Copilot app

    Footer

    © 2026 GitHub, Inc.