GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test_bdb is sensitive to sys.meta_path manipulation · Issue #93951 · python/cpython

test_bdb is sensitive to sys.meta_path manipulation #93951

New issue
Copy link
New issue
Copy link
Closed
#93962
Closed
test_bdb is sensitive to sys.meta_path manipulation#93951
#93962
Copy link

Description

@jaraco
jaraco
opened on Jun 17, 2022
Issue body actions

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)

Activity

  1. jaraco commented on Jun 17, 2022

    @jaraco
    jaraco
    on Jun 17, 2022
    MemberAuthor
    More actions

    I propose for consideration - perhaps this test should be configured to be skipped if sys.meta_path is not in an expected state. Or perhaps it should enforce it to be in an expected state.

  2. jaraco
    added 2 commits that reference this issue on Jun 17, 2022

    gh-93951: In test_bdb.StateTestCase.test_skip, avoid including auxili…

    d36b0dd

    gh-93951: In test_bdb.StateTestCase.test_skip, avoid including auxili…

    27d86b9
  3. ambv
    closed this as completedin #93962on Jun 22, 2022
  4. ambv
    added a commit that references this issue on Jun 22, 2022

    gh-93951: In test_bdb.StateTestCase.test_skip, avoid including auxili…

    c029b55
  5. miss-islington
    added 2 commits that reference this issue on Jun 22, 2022

    pythongh-93951: In test_bdb.StateTestCase.test_skip, avoid including …

    8c3299c

    pythongh-93951: In test_bdb.StateTestCase.test_skip, avoid including …

    01b96c2
  6. ambv
    added 2 commits that reference this issue on Jun 22, 2022

    gh-93951: In test_bdb.StateTestCase.test_skip, avoid including auxili…

    e631d98

    gh-93951: In test_bdb.StateTestCase.test_skip, avoid including auxili…

    798ace5
  7. serhiy-storchaka
    added a commit that references this issue on Jun 26, 2022

    Revert 30935 defer bpo45162 to 312 (#94285)

    1ffde3e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.