Don't mangle the shebangs of test files

Shebangs are mangled from #!/bin/bash to #!/usr/bin/bash, which causes
the change in data_offset calculated in tests, resulting in a
test_zipfile failure:

FAIL: test_data_offset_with_exe_prepended
(test.test_zipfile.test_core.TestDataOffsetPrependedZip.test_data_offset_with_exe_prepended)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.14/test/test_zipfile/test_core.py", line
  3431, in test_data_offset_with_exe_prepended
      self._test_data_offset(self.exe_zip)
      ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/usr/lib64/python3.14/test/test_zipfile/test_core.py",
  line 3428, in _test_data_offset
      self.assertEqual(zipfp.data_offset, 713)
      ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 717 != 713
This commit is contained in:
Karolina Surma 2025-04-14 11:39:12 +02:00
commit 81efe7427b
2 changed files with 6 additions and 3 deletions

View file

@ -209,6 +209,10 @@ Provides: bundled(python3dist(packaging)) = 24
# Remove the default -O2 flag, our flags are applied in %%build/%%install
%global __global_compiler_flags %(echo '%{__global_compiler_flags}' | sed 's/-O[[:digit:]]//')
# Changing the shebangs of the test files confuses the tests which count with a specific data offset
# We can't remove the executable bit, the files are run directly in other tests
%global __brp_mangle_shebangs_exclude_from ^%{pylibdir}/test/archivetestdata/exe_with_.*$
# Disable automatic bytecompilation. The python3 binary is not yet be
# available in /usr/bin when Python is built. Also, the bytecompilation fails
# on files that test invalid syntax.

View file

@ -30,12 +30,11 @@
run: "PYTHON=python{{ pybasever }}d TOX=false VERSION={{ pybasever }} CYTHON=false ./venv.sh"
- selftest:
dir: python/selftest
# test_data_offset_with_exe_prepended and test_data_offset_with_exe_prepended_zip64: https://github.com/python/cpython/issues/84481
run: "VERSION={{ pybasever }} X='-i test_check_probes -i test_sysconfigdata_json -i test_data_offset_with_exe_prepended -i test_data_offset_with_exe_prepended_zip64' ./parallel.sh"
run: "VERSION={{ pybasever }} X='-i test_check_probes -i test_sysconfigdata_json' ./parallel.sh"
- debugtest:
dir: python/selftest
# test_base_interpreter: https://github.com/python/cpython/issues/131372
run: "VERSION={{ pybasever }} PYTHON=python{{ pybasever }}d X='-i test_check_probes -i test_sysconfigdata_json -i test_base_interpreter -i test_data_offset_with_exe_prepended -i test_data_offset_with_exe_prepended_zip64' ./parallel.sh"
run: "VERSION={{ pybasever }} PYTHON=python{{ pybasever }}d X='-i test_check_probes -i test_sysconfigdata_json -i test_base_interpreter' ./parallel.sh"
- optimizedflags:
dir: python/flags
run: "python{{ pybasever }} ./assertflags.py -O3 CFLAGS PY_BUILTIN_MODULE_CFLAGS PY_CFLAGS PY_CORE_CFLAGS PY_CFLAGS_NODIST PY_STDMODULE_CFLAGS"