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 — Various test failures if PYTHONUSERBASE is not canonicalized · Issue #77403 · python/cpython

Various test failures if PYTHONUSERBASE is not canonicalized #77403

New issue
Copy link
New issue
Copy link
Closed
#93917
Closed
Various test failures if PYTHONUSERBASE is not canonicalized#77403
#93917
Copy link
Labels
3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixes3.12only security fixesonly security fixeseasytestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@jdemeyer
jdemeyer
opened on Apr 4, 2018
Issue body actions
BPO 33222
Nosy @ned-deily, @jdemeyer, @nitishch, @akshaysharma096, @iritkatriel
PRs
  • bpo-33222: Add canonicalisation to paths in site test suite. #6434
  • 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 = None
    created_at = <Date 2018-04-04.14:00:04.403>
    labels = ['easy', 'type-bug', '3.9', '3.10', '3.11', 'tests']
    title = 'Various test failures if PYTHONUSERBASE is not canonicalized'
    updated_at = <Date 2022-01-31.01:00:24.460>
    user = 'https://github.com/jdemeyer'

    bugs.python.org fields:

    activity = <Date 2022-01-31.01:00:24.460>
    actor = 'iritkatriel'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Tests']
    creation = <Date 2018-04-04.14:00:04.403>
    creator = 'jdemeyer'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 33222
    keywords = ['patch', 'easy']
    message_count = 8.0
    messages = ['314931', '315088', '315135', '412182', '412184', '412185', '412186', '412187']
    nosy_count = 5.0
    nosy_names = ['ned.deily', 'jdemeyer', 'nitishch', 'akshaysharma096', 'iritkatriel']
    pr_nums = ['6434']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue33222'
    versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

    Activity

    1. jdemeyer commented on Apr 4, 2018

      @jdemeyer
      jdemeyer
      on Apr 4, 2018
      ContributorAuthor
      More actions

      Setting PYTHONUSERBASE=/tmp/x/.. causes the Python test suite to fail:

      ======================================================================
      FAIL: test_user_similar (test.test_sysconfig.TestSysConfig)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/usr/local/src/sage-config/local/src/cpython/Lib/test/test_sysconfig.py", line 276, in test_user_similar
          self.assertEqual(user_path, global_path.replace(base, user, 1))
      AssertionError: '/tmp/lib/python3.8' != '/tmp/x/../lib/python3.8'
      - /tmp/lib/python3.8
      + /tmp/x/../lib/python3.8
      ?     +++++

      ======================================================================
      FAIL: test_get_path (test.test_site.HelperFunctionsTests)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/usr/local/src/sage-config/local/src/cpython/Lib/test/test_site.py", line 192, in test_get_path
          sysconfig.get_path('purelib', scheme))
      AssertionError: '/tmp/x/../lib/python3.8/site-packages' != '/tmp/lib/python3.8/site-packages'
      - /tmp/x/../lib/python3.8/site-packages
      ?     

      + /tmp/lib/python3.8/site-packages

      ======================================================================
      FAIL: test_s_option (test.test_site.HelperFunctionsTests)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/usr/local/src/sage-config/local/src/cpython/Lib/test/test_site.py", line 199, in test_s_option
          self.assertIn(usersite, sys.path)
      AssertionError: '/tmp/x/../lib/python3.8/site-packages' not found in ['/usr/local/src/sage-config/local/src/cpython', '/usr/local/src/sage-config/local/lib/python38.zip', '/usr/local/src/sage-config/local/src/cpython/Lib', '/usr/local/src/sage-config/local/src/cpython/build/lib.linux-x86_64-3.8', '/usr/local/src/sage-config/local/lib/python3.8/site-packages']
    2. jdemeyer
      added
      3.8 (EOL)end of lifeend of life
      testsTests in the Lib/test dirTests in the Lib/test dir
      type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
      on Apr 4, 2018
    3. ned-deily commented on Apr 8, 2018

      @ned-deily
      ned-deily
      on Apr 8, 2018
      Member
      More actions

      Would you care to provide a PR fix with a test?

    4. ned-deily
      added
      easy
      on Apr 8, 2018
    5. akshaysharma096 commented on Apr 9, 2018

      @akshaysharma096
      akshaysharma096mannequin
      on Apr 9, 2018
      Mannequin
      More actions

      What are the possible cases we can have here ?

    6. iritkatriel commented on Jan 31, 2022

      @iritkatriel
      iritkatriel
      on Jan 31, 2022
      Member
      More actions

      I tested on a map and I only got the failure in test_s_option, which seems right because that directory is indeed not in sys.path.

    7. ned-deily commented on Jan 31, 2022

      @ned-deily
      ned-deily
      on Jan 31, 2022
      Member
      More actions

      FWIW, I still see the same failures with 3.10.2 on a current macOS 12.2 system.

    8. iritkatriel commented on Jan 31, 2022

      @iritkatriel
      iritkatriel
      on Jan 31, 2022
      Member
      More actions

      I tested 3.11 (on a Mac 11.6).

    9. ned-deily commented on Jan 31, 2022

      @ned-deily
      ned-deily
      on Jan 31, 2022
      Member
      More actions

      I tested 3.11 (on a Mac 11.6).

      It still fails for me on current main HEAD (on 12.2 FWIW):

      $ ./configure --prefix=/tmp/p
      $ make -j6
      $ mkdir /tmp/x
      $ export PYTHONUSERBASE=/tmp/x/..
      $ ./python -m test -w test_site test_sysconfig
      Raised RLIMIT_NOFILE: 256 -> 1024
      0:00:00 load avg: 0.99 Run tests sequentially
      0:00:00 load avg: 0.99 [1/2] test_site
      test test_site failed -- multiple errors occurred; run in verbose mode for details
      0:00:00 load avg: 0.99 [2/2/1] test_sysconfig -- test_site failed (2 failures)
      test test_sysconfig failed -- Traceback (most recent call last):
        File "/Users/nad/Projects/PyDev/active/dev/3x/source/Lib/test/test_sysconfig.py", line 314, in test_user_similar
          self.assertEqual(user_path, expected)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      AssertionError: '/tmp/lib/python3.11' != '/tmp/x/../lib/python3.11'
      - /tmp/lib/python3.11
      + /tmp/x/../lib/python3.11
      ?     +++++

      test_sysconfig failed (1 failure)

      == Tests result: FAILURE ==

      2 tests failed:
      test_site test_sysconfig
      0:00:00 load avg: 0.99
      0:00:00 load avg: 0.99 Re-running failed tests in verbose mode
      0:00:00 load avg: 0.99 Re-running test_site in verbose mode (matching: test_get_path, test_s_option)
      test_get_path (test.test_site.HelperFunctionsTests) ... FAIL
      test_s_option (test.test_site.HelperFunctionsTests) ... FAIL

      ======================================================================
      FAIL: test_get_path (test.test_site.HelperFunctionsTests)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/Users/nad/Projects/PyDev/active/dev/3x/source/Lib/test/test_site.py", line 209, in test_get_path
          self.assertEqual(site._get_path(site._getuserbase()),
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      AssertionError: '/tmp/x/../lib/python/site-packages' != '/tmp/lib/python/site-packages'
      - /tmp/x/../lib/python/site-packages
      ?     

      + /tmp/lib/python/site-packages

      ======================================================================
      FAIL: test_s_option (test.test_site.HelperFunctionsTests)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/Users/nad/Projects/PyDev/active/dev/3x/source/Lib/test/test_site.py", line 218, in test_s_option
          self.assertIn(usersite, sys.path)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      AssertionError: '/tmp/x/../lib/python3.11/site-packages' not found in ['/Users/nad/Projects/PyDev/active/dev/3x/source', '/tmp/p/lib/python311.zip', '/Users/nad/Projects/PyDev/active/dev/3x/source/Lib', '/Users/nad/Projects/PyDev/active/dev/3x/source/build/lib.macosx-12.2-x86_64-3.11', '/tmp/lib/python3.11/site-packages']

      Ran 2 tests in 0.002s

      FAILED (failures=2)
      test test_site failed
      0:00:00 load avg: 0.99 Re-running test_sysconfig in verbose mode (matching: test_user_similar)
      test_user_similar (test.test_sysconfig.TestSysConfig) ... FAIL

      ======================================================================
      FAIL: test_user_similar (test.test_sysconfig.TestSysConfig)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/Users/nad/Projects/PyDev/active/dev/3x/source/Lib/test/test_sysconfig.py", line 314, in test_user_similar
          self.assertEqual(user_path, expected)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      AssertionError: '/tmp/lib/python3.11' != '/tmp/x/../lib/python3.11'
      - /tmp/lib/python3.11
      + /tmp/x/../lib/python3.11
      ?     +++++

      Ran 1 test in 0.001s

      FAILED (failures=1)
      test test_sysconfig failed
      2 tests failed again:
      test_site test_sysconfig

      == Tests result: FAILURE then FAILURE ==

      2 tests failed:
      test_site test_sysconfig

      2 re-run tests:
      test_site test_sysconfig

      Total duration: 350 ms
      Tests result: FAILURE then FAILURE

    10. iritkatriel commented on Jan 31, 2022

      @iritkatriel
      iritkatriel
      on Jan 31, 2022
      Member
      More actions

      Maybe I did something wrong. Will check tomorrow. In the meantime I’m updating the versions. Thanks for double checking.

    11. iritkatriel
      added
      3.9 (EOL)end of lifeend of life
      3.10 (EOL)end of lifeend of life
      3.11only security fixesonly security fixes
      and removed
      3.8 (EOL)end of lifeend of life
      on Jan 31, 2022
    12. ezio-melotti
      transferred this issue fromon Apr 10, 2022
    13. iritkatriel
      added a commit that references this issue on Jun 16, 2022

      pythonGH-77403: Fix tests which fail when PYTHONUSERBASE is not norma…

      4732fce
    14. iritkatriel
      added
      3.12only security fixesonly security fixes
      and removed
      3.9 (EOL)end of lifeend of life
      on Jun 16, 2022
    15. iritkatriel
      closed this as completedin #93917on Jun 17, 2022
    16. miss-islington
      added 2 commits that reference this issue on Jun 17, 2022

      pythonGH-77403: Fix tests which fail when PYTHONUSERBASE is not norma…

      106d7a8

      pythonGH-77403: Fix tests which fail when PYTHONUSERBASE is not norma…

      00bb7f6
    17. iritkatriel
      added a commit that references this issue on Jun 17, 2022

      GH-77403: Fix tests which fail when PYTHONUSERBASE is not normalized (G…

      b1ae4af
    18. serhiy-storchaka
      added a commit that references this issue on Jun 26, 2022

      Revert 30935 defer bpo45162 to 312 (#94285)

      1ffde3e
    19. miss-islington
      added 2 commits that reference this issue on Jun 30, 2022

      [3.11] GH-77403: Fix tests which fail when PYTHONUSERBASE is not norm…

      c5ecfa0

      [3.10] GH-77403: Fix tests which fail when PYTHONUSERBASE is not norm…

      226fdce
    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.10 (EOL)end of lifeend of life3.11only security fixesonly security fixes3.12only security fixesonly security fixeseasytestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

      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.