8000 test_sysconfig.TestSysConfig.test_sysconfigdata_json fails: it expects 'userbase' to be '/root/.local' · Issue #128055 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
befeleme opened this issue Dec 18, 2024 · 5 comments · Fixed by #128070
Labels
tests Tests in the Lib/test dir topic-sysconfig type-bug An unexpected behavior, bug, or error

Comments

@befeleme
Copy link
Contributor
befeleme commented Dec 18, 2024

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

@befeleme befeleme added the type-bug An unexpected behavior, bug, or error label Dec 18, 2024
@Eclips4 Eclips4 added tests Tests in the Lib/test dir topic-sysconfig labels Dec 18, 2024
@Eclips4
Copy link
Member
Eclips4 commented Dec 18, 2024

cc @FFY00

@FFY00
Copy link
Member
FFY00 commented Dec 18, 2024

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

@befeleme
Copy link
Contributor Author

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.

@FFY00
Copy link
Member
FFY00 commented Dec 18, 2024

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.

@befeleme
Copy link
Contributor Author

You are running the tests after installation, right?

Yes. Thank you for looking into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir topic-sysconfig type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
0