Skip to content

test_sysconfig.TestSysConfig.test_sysconfigdata_json fails: it expects 'userbase' to be '/root/.local' #128055

Closed

Description

@befeleme

Bug report

Bug description:

As in the title. We hit this in Fedora, can it be caused by the mismatch of users (one which generated the file, the other which runs tests?)

FAIL: test_sysconfigdata_json (test.test_sysconfig.TestSysConfig.test_sysconfigdata_json)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.14/test/test_sysconfig.py", line 671, in test_sysconfigdata_json
    self.assertEqual(system_config_vars, json_config_vars)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<snip>
-  'userbase': '/root/.local'}
?                 ---

+  'userbase': '/builddir/.local'}
?                +++++++

CPython versions tested on:

3.14

Operating systems tested on:

Linux

Linked PRs

Activity

  1. Eclips4 commented on Dec 18, 2024

    @Eclips4
    Member
  2. FFY00 commented on Dec 18, 2024

    @FFY00
    Member

    @befeleme thanks for the report, please provide reproduction instructions, otherwise I can't debug the issue.

  3. befeleme commented on Dec 18, 2024

    @befeleme
    ContributorAuthor

    For now I only have a Fedora-specific example. I'm not sure whether this is something related to our environment only or a general issue. It appeared on our CI which installs the built Python rpm package and runs the test suite in a fresh environment. I don't control the environment, but you can see the results here: https://artifacts.dev.testing-farm.io/a7c444e9-2e53-4a09-8a5a-33666297c776/#artifacts-git-refs-pull-19-headndwq3vz8/tests/tests.yml

    To reproduce with a Fedora Rawhide container:
    python3.14.0a3 as an RPM can be found here: https://koji.fedoraproject.org/koji/taskinfo?taskID=126962646
    python3.14-libs contains the /usr/lib64/python3.14/_sysconfig_vars__linux_x86_64-linux-gnu.json file, which was generated during the build, hence the 'userbase' is set to '/builddir/.local'.
    For convenience, download all the python3.14-*.x86_64.rpm to a fresh Fedora Rawhide container.
    Install with: dnf install python3.14*
    Run python3.14 -m test test_sysconfig - the same AssertionError appears.

    I'm trying to find a better reproducer that wouldn't require rpm magic.

  4. added a commit that references this issue on Dec 18, 2024
  5. FFY00 commented on Dec 18, 2024

    @FFY00
    Member

    You are running the tests after installation, right? Since userbase is generated dynamically, it would change after installing. I opened GH-128070 to make the test ignore userbase. I also opened GH-128072 to explore a way to mitigate this kind of issues.

    Feel free to ignore this test for now, or backport the fix. The failure is a false positive, it does not expose a real bug.

  6. befeleme commented on Dec 19, 2024

    @befeleme
    ContributorAuthor

    You are running the tests after installation, right?

    Yes. Thank you for looking into this.

  7. added 2 commits that reference this issue on Apr 2, 2025
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

    testsTests in the Lib/test dirtopic-sysconfigtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions