forked from pool/python313
Checks consistency of the zip64 end of central directory record, and preventing obfuscation of the payload, i.e., you scanning for malicious content in a ZIP file with one ZIP parser (let's say a Rust one) then unpack it in production with another (e.g., the Python one) and get malicious content that the other parser did not see (CVE-2025-8291, bsc#1251305) Readjust patches while synchronizing between openSUSE and SLE trees: - F00251-change-user-install-location.patch - doc-py38-to-py36.patch - gh126985-mv-pyvenv.cfg2getpath.patch
96 lines
3.6 KiB
Diff
96 lines
3.6 KiB
Diff
commit 2b0e2b2893a821ca36cd65a204bed932741ac189
|
|
Author: Filipe Laíns 🇵🇸 <lains@riseup.net>
|
|
Date: Tue Nov 26 13:46:33 2024 +0000
|
|
|
|
GH-126985: move pyvenv.cfg detection from site to getpath (#126987)
|
|
|
|
---
|
|
Lib/test/test_sysconfig.py | 67 ---------------------------------------------
|
|
1 file changed, 1 insertion(+), 66 deletions(-)
|
|
|
|
Index: Python-3.13.9/Lib/test/test_sysconfig.py
|
|
===================================================================
|
|
--- Python-3.13.9.orig/Lib/test/test_sysconfig.py 2025-11-04 17:41:28.521386489 +0100
|
|
+++ Python-3.13.9/Lib/test/test_sysconfig.py 2025-11-04 17:42:36.888243505 +0100
|
|
@@ -110,6 +110,7 @@
|
|
**venv_create_args,
|
|
)
|
|
|
|
+
|
|
def test_get_path_names(self):
|
|
self.assertEqual(get_path_names(), sysconfig._SCHEME_KEYS)
|
|
|
|
@@ -611,72 +612,6 @@
|
|
suffix = sysconfig.get_config_var('EXT_SUFFIX')
|
|
self.assertTrue(suffix.endswith('-darwin.so'), suffix)
|
|
|
|
- @requires_subprocess()
|
|
- def test_config_vars_depend_on_site_initialization(self):
|
|
- script = textwrap.dedent("""
|
|
- import sysconfig
|
|
-
|
|
- config_vars = sysconfig.get_config_vars()
|
|
-
|
|
- import json
|
|
- print(json.dumps(config_vars, indent=2))
|
|
- """)
|
|
-
|
|
- with self.venv() as venv:
|
|
- site_config_vars = json.loads(venv.run('-c', script).stdout)
|
|
- no_site_config_vars = json.loads(venv.run('-S', '-c', script).stdout)
|
|
-
|
|
- self.assertNotEqual(site_config_vars, no_site_config_vars)
|
|
- # With the site initialization, the virtual environment should be enabled.
|
|
- self.assertEqual(site_config_vars['base'], venv.prefix)
|
|
- self.assertEqual(site_config_vars['platbase'], venv.prefix)
|
|
- #self.assertEqual(site_config_vars['prefix'], venv.prefix) # # FIXME: prefix gets overwriten by _init_posix
|
|
- # Without the site initialization, the virtual environment should be disabled.
|
|
- self.assertEqual(no_site_config_vars['base'], site_config_vars['installed_base'])
|
|
- self.assertEqual(no_site_config_vars['platbase'], site_config_vars['installed_platbase'])
|
|
-
|
|
- @requires_subprocess()
|
|
- def test_config_vars_recalculation_after_site_initialization(self):
|
|
- script = textwrap.dedent("""
|
|
- import sysconfig
|
|
-
|
|
- before = sysconfig.get_config_vars()
|
|
-
|
|
- import site
|
|
- site.main()
|
|
-
|
|
- after = sysconfig.get_config_vars()
|
|
-
|
|
- import json
|
|
- print(json.dumps({'before': before, 'after': after}, indent=2))
|
|
- """)
|
|
-
|
|
- with self.venv() as venv:
|
|
- config_vars = json.loads(venv.run('-S', '-c', script).stdout)
|
|
-
|
|
- self.assertNotEqual(config_vars['before'], config_vars['after'])
|
|
- self.assertEqual(config_vars['after']['base'], venv.prefix)
|
|
- #self.assertEqual(config_vars['after']['prefix'], venv.prefix) # FIXME: prefix gets overwriten by _init_posix
|
|
- #self.assertEqual(config_vars['after']['exec_prefix'], venv.prefix) # FIXME: exec_prefix gets overwriten by _init_posix
|
|
-
|
|
- @requires_subprocess()
|
|
- def test_paths_depend_on_site_initialization(self):
|
|
- script = textwrap.dedent("""
|
|
- import sysconfig
|
|
-
|
|
- paths = sysconfig.get_paths()
|
|
-
|
|
- import json
|
|
- print(json.dumps(paths, indent=2))
|
|
- """)
|
|
-
|
|
- with self.venv() as venv:
|
|
- site_paths = json.loads(venv.run('-c', script).stdout)
|
|
- no_site_paths = json.loads(venv.run('-S', '-c', script).stdout)
|
|
-
|
|
- self.assertNotEqual(site_paths, no_site_paths)
|
|
-
|
|
-
|
|
class MakefileTests(unittest.TestCase):
|
|
|
|
@unittest.skipIf(sys.platform.startswith('win'),
|