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.