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___all__ and test_distutils alters the enviroinment: pkg_resources.PEP440Warning · Issue #84236 · python/cpython

test___all__ and test_distutils alters the enviroinment: pkg_resources.PEP440Warning #84236

New issue
Copy link
New issue
Copy link
Closed
Closed
test___all__ and test_distutils alters the enviroinment: pkg_resources.PEP440Warning#84236
Copy link
Labels
3.7 (EOL)end of lifeend of life3.8 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytestsTests in the Lib/test dirTests in the Lib/test dir

Description

@vstinner
vstinner
opened on Mar 24, 2020
Issue body actions
BPO 40055
Nosy @vstinner, @merwok, @dstufft, @miss-islington
PRs
  • bpo-40055: distutils tests now disable docutils import #19139
  • bpo-40055: Fix warnings filters in test_distutils #20095
  • [3.8] bpo-40055: test_distutils leaves warnings filters unchanged (GH-20095) #20109
  • [3.7] bpo-40055: test_distutils leaves warnings filters unchanged (GH-20095) #20110
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2020-05-16.09:39:36.483>
    created_at = <Date 2020-03-24.16:51:30.783>
    labels = ['tests', '3.8', '3.7', 'library', '3.9']
    title = 'test___all__ and test_distutils alters the enviroinment: pkg_resources.PEP440Warning'
    updated_at = <Date 2020-05-16.09:39:36.483>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2020-05-16.09:39:36.483>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-05-16.09:39:36.483>
    closer = 'vstinner'
    components = ['Distutils', 'Tests']
    creation = <Date 2020-03-24.16:51:30.783>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 40055
    keywords = ['patch']
    message_count = 5.0
    messages = ['364941', '364942', '368954', '368955', '368956']
    nosy_count = 4.0
    nosy_names = ['vstinner', 'eric.araujo', 'dstufft', 'miss-islington']
    pr_nums = ['19139', '20095', '20109', '20110']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue40055'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9']

    Activity

    1. vstinner commented on Mar 24, 2020

      @vstinner
      vstinner
      on Mar 24, 2020
      MemberAuthor
      More actions

      Even when no test is run, test_distutils alters the environment:

      $ ./python -m test -v --fail-env-changed test_distutils -m DONTEXISTS
      == CPython 3.7.7+ (heads/3.7:1cdc61c767, Mar 24 2020, 17:25:30) [GCC 9.2.1 20190827 (Red Hat 9.2.1-1)]
      == Linux-5.5.9-200.fc31.x86_64-x86_64-with-fedora-31-Thirty_One little-endian
      == cwd: /home/vstinner/python/3.7/build/test_python_157151
      == CPU count: 8
      == encodings: locale=UTF-8, FS=utf-8
      0:00:00 load avg: 0.37 Run tests sequentially
      0:00:00 load avg: 0.37 [1/1] test_distutils

      Ran 0 tests in 0.001s

      OK
      Warning -- warnings.filters was modified by test_distutils
      Before: (140048876788832, [], [])
      After: (140048876788832, [], [('ignore', None, <class 'pkg_resources.PEP440Warning'>, None, 0)])
      test_distutils run no tests

      == Tests result: NO TEST RUN ==

      1 test run no tests:
      test_distutils

      Total duration: 655 ms
      Tests result: NO TEST RUN

      The problem comes from Lib/distutils/tests/test_check.py: "from distutils.command.check import check, HAS_DOCUTILS" imports indirectly the docutils module which imports pkg_resources.

      pkg_resources changes warnings filters.

      docutils is installed by python3-docutils-0.15.2-1.fc31.noarch package and pkg_resources comes from python3-setuptools-41.6.0-1.fc31.noarch package.

      Attached PR disables docutils to avoid side effects of "import docutils" like pkg_resources modifying warnings filters.

    2. vstinner
      added
      3.7 (EOL)end of lifeend of life
      3.8 (EOL)end of lifeend of life
      3.9 (EOL)end of lifeend of life
      stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
      testsTests in the Lib/test dirTests in the Lib/test dir
      on Mar 24, 2020
    3. vstinner commented on Mar 24, 2020

      @vstinner
      vstinner
      on Mar 24, 2020
      MemberAuthor
      More actions

      pkg_resources comes from python3-setuptools-41.6.0-1.fc31.noarch package.

      Here is the line which alters warnings filters:

      $ grep warnings /usr/lib/python3.7/site-packages/pkg_resources/__init__.py
      (...)
      warnings.filterwarnings("ignore", category=PEP440Warning, append=True)
    4. vstinner commented on May 15, 2020

      @vstinner
      vstinner
      on May 15, 2020
      MemberAuthor
      More actions

      New changeset 6e57237 by Victor Stinner in branch 'master':
      bpo-40055: test_distutils leaves warnings filters unchanged (GH-20095)
      6e57237

    5. miss-islington commented on May 15, 2020

      @miss-islington
      miss-islington
      on May 15, 2020
      Contributor
      More actions

      New changeset 7ef2751 by Miss Islington (bot) in branch '3.7':
      bpo-40055: test_distutils leaves warnings filters unchanged (GH-20095)
      7ef2751

    6. miss-islington commented on May 15, 2020

      @miss-islington
      miss-islington
      on May 15, 2020
      Contributor
      More actions

      New changeset 4e6545b by Miss Islington (bot) in branch '3.8':
      bpo-40055: test_distutils leaves warnings filters unchanged (GH-20095)
      4e6545b

    7. vstinner
      closed this as completedon May 16, 2020
    8. vstinner
      closed this as completedon May 16, 2020
    9. ezio-melotti
      transferred this issue fromon Apr 10, 2022
    10. miss-islington
      added 2 commits that reference this issue on Aug 9, 2022

      gh-95349: Hide a Distutils Warning Filter for test_check_c_globals (G…

      3ff6d9a

      pythongh-95349: Hide a Distutils Warning Filter for test_check_c_glob…

      eea836c
    11. ambv
      added a commit that references this issue on Aug 10, 2022

      gh-95349: Hide a Distutils Warning Filter for test_check_c_globals (G…

      2c4bd21
    12. miss-islington
      added 2 commits that reference this issue on Aug 10, 2022

      pythongh-95349: Hide a Distutils Warning Filter for test_check_c_glob…

      0d7ed30

      gh-95349: Hide a Distutils Warning Filter for test_check_c_globals (G…

      b11895e
    13. iritkatriel
      added a commit that references this issue on Aug 11, 2022

      pythongh-95349: Hide a Distutils Warning Filter for test_check_c_glob…

      9f5868c
    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

      3.7 (EOL)end of lifeend of life3.8 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytestsTests in the Lib/test dirTests in the Lib/test dir

      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.