Skip to content
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

test_embed.test_init_pyvenv_cfg fails #128690

Open
WolframAlph opened this issue Jan 9, 2025 · 1 comment
Open

test_embed.test_init_pyvenv_cfg fails #128690

WolframAlph opened this issue Jan 9, 2025 · 1 comment
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@WolframAlph
Copy link
Contributor

WolframAlph commented Jan 9, 2025

Bug report

Bug description:

Trying to build Python from main branch and running tests on MacOS 15.2 fails on test_embed.test_init_pyvenv_cfg.

./configure && make -j && ./python.exe -m test test_embed
FAIL: test_init_pyvenv_cfg (test.test_embed.InitConfigTests.test_init_pyvenv_cfg)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/yyanchii/Desktop/cpython/Lib/test/test_embed.py", line 1671, in test_init_pyvenv_cfg
    self.check_all_configs("test_init_compat_config", config,
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                           api=API_COMPAT, env=env,
                           ^^^^^^^^^^^^^^^^^^^^^^^^
                           ignore_stderr=True, cwd=tmpdir)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/yyanchii/Desktop/cpython/Lib/test/test_embed.py", line 939, in check_all_configs
    self.check_config(configs, expected_config)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/yyanchii/Desktop/cpython/Lib/test/test_embed.py", line 865, in check_config
    self.assertEqual(config, expected)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
AssertionError: {'argv': [''], 'base_exec_prefix': '/usr/lo[2028 chars]None} != {'_config_init': 1, 'isolated': False, 'use[2128 chars]alse}
  {'_config_init': 1,
   '_init_main': True,
   '_install_importlib': True,
   'argv': [''],
-  'base_exec_prefix': '/usr/local',
+  'base_exec_prefix': '/var/folders/z9/tt4sxxm159zbh6xlm2mhrg4r0000gp/T/tmp_o9bmpp_',
   'base_executable': '/var/folders/z9/tt4sxxm159zbh6xlm2mhrg4r0000gp/T/tmp_o9bmpp_/_testembed',
   'base_prefix': '/usr/local',
   'buffered_stdio': True,
   'bytes_warning': 0,
   'check_hash_pycs_mode': 'default',
   'code_debug_ranges': True,
   'configure_c_stdio': False,
   'cpu_count': -1,
   'dev_mode': False,
   'dump_refs': False,
   'dump_refs_file': None,
   'exec_prefix': '/private/var/folders/z9/tt4sxxm159zbh6xlm2mhrg4r0000gp/T/tmp_7n79vly',
   'executable': '/private/var/folders/z9/tt4sxxm159zbh6xlm2mhrg4r0000gp/T/tmp_7n79vly/_testembed',
   'faulthandler': False,
   'hash_seed': 0,
   'home': None,
   'import_time': False,
   'inspect': False,
   'install_signal_handlers': True,
   'int_max_str_digits': 4300,
   'interactive': False,
   'isolated': False,
   'malloc_stats': False,
   'module_search_paths': ['/usr/local/lib/python314.zip',
                           '/Users/yyanchii/Desktop/cpython/Lib',
                           '/Users/yyanchii/Desktop/cpython/build/lib.macosx-15.2-arm64-3.14',
                           '/usr/local/lib/python314.zip',
                           '/usr/local/lib/python3.14',
-                          '/usr/local/lib/python3.14/lib-dynload'],
+                          '/var/folders/z9/tt4sxxm159zbh6xlm2mhrg4r0000gp/T/tmp_o9bmpp_/lib/python3.14/lib-dynload'],
   'module_search_paths_set': True,
   'optimization_level': 0,
   'orig_argv': [],
   'parse_argv': False,
   'parser_debug': False,
   'pathconfig_warnings': True,
   'perf_profiling': 0,
   'platlibdir': 'lib',
   'prefix': '/private/var/folders/z9/tt4sxxm159zbh6xlm2mhrg4r0000gp/T/tmp_7n79vly',
   'program_name': './_testembed',
   'pycache_prefix': None,
   'pythonpath_env': '/usr/local/lib/python314.zip:/Users/yyanchii/Desktop/cpython/Lib:/Users/yyanchii/Desktop/cpython/build/lib.macosx-15.2-arm64-3.14',
   'quiet': False,
   'run_command': None,
   'run_filename': None,
   'run_module': None,
   'run_presite': None,
   'safe_path': False,
   'show_ref_count': False,
   'site_import': True,
   'skip_source_first_line': False,
   'sys_path_0': None,
   'tracemalloc': 0,
   'use_environment': True,
   'use_frozen_modules': False,
   'use_hash_seed': False,
   'use_system_logger': False,
   'user_site_directory': True,
   'verbose': 0,
   'warn_default_encoding': False,
   'warnoptions': [],
   'write_bytecode': True,
   'xoptions': {}}

----------------------------------------------------------------------
Ran 82 tests in 5.051s

FAILED (failures=1, skipped=3)
test test_embed failed
test_embed failed (1 failure)

== Tests result: FAILURE ==

1 test failed:
    test_embed

Total duration: 5.1 sec
Total tests: run=82 failures=1 skipped=3
Total test files: run=1/1 failed=1
Result: FAILURE

After bisecting found out 34e840f9ddd commit to be the reason. cc @FFY00

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

Linked PRs

@WolframAlph WolframAlph added the type-bug An unexpected behavior, bug, or error label Jan 9, 2025
@FFY00
Copy link
Member

FFY00 commented Jan 11, 2025

The test is mocking an installation, and we now return more accurate information since the prefix comes from the runtime library instead of pyvenv.cfg, so we can just skip the test when running with a shared library, since pyvenv.cfg is no longer relevant here.

FFY00 added a commit to FFY00/cpython that referenced this issue Jan 11, 2025
@picnixz picnixz added the tests Tests in the Lib/test dir label Jan 11, 2025
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 type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants