[New-bugs-announce] [issue43372] ctypes: test_frozentable fails when make regen-frozen

Miro Hrončok report at bugs.python.org
Tue Mar 2 09:40:34 EST 2021


New submission from Miro Hrončok <miro at hroncok.cz>:

The following test failure happens on Python 3.10.0a6+ when we make regen-frozen with the same Python version we test:

======================================================================
FAIL: test_frozentable (ctypes.test.test_values.PythonValuesTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/churchyard/Dokumenty/RedHat/cpython/Lib/ctypes/test/test_values.py", line 87, in test_frozentable
    self.assertEqual(items, expected, "PyImport_FrozenModules example "
AssertionError: Lists differ: [('__hello__', 129), ('__phello__', -129), ('__phello__.spam', 129)] != [('__hello__', 125), ('__phello__', -125), ('__phello__.spam', 125)]

First differing element 0:
('__hello__', 129)
('__hello__', 125)

- [('__hello__', 129), ('__phello__', -129), ('__phello__.spam', 129)]
?                  ^                     ^                         ^

+ [('__hello__', 125), ('__phello__', -125), ('__phello__.spam', 125)]
?                  ^                     ^                         ^
 : PyImport_FrozenModules example in Doc/library/ctypes.rst may be out of date

----------------------------------------------------------------------
Ran 494 tests in 0.466s

FAILED (failures=1, skipped=87)


Reproducer:

1. Build Python from source: $ ./configure && make -j...
2. Run ctypes tests: $ ./python -m ctypes.test
3. Regenerate frozen: $ PYTHON_FOR_REGEN=./python make regen-frozen
4. Build Python from source again: $ ./configure && make -j...
5. Run ctypes tests: $ ./python -m ctypes.test

Actual result:

Tests in (2) pass, tests in (5) fail.

The difference after (3) is:

diff --git a/Python/frozen_hello.h b/Python/frozen_hello.h
index 9c566cc81e..d58b726aa8 100644
--- a/Python/frozen_hello.h
+++ b/Python/frozen_hello.h
@@ -9,5 +9,5 @@ static unsigned char M___hello__[] = {
     100,218,5,112,114,105,110,116,169,0,114,2,0,
     0,0,114,2,0,0,0,218,4,110,111,110,101,
     218,8,60,109,111,100,117,108,101,62,1,0,0,
-    0,115,2,0,0,0,4,1,
+    0,115,6,0,0,0,4,0,12,1,255,128,
 };


Expected results:

Tests pass, no diff.

----------
components: Tests, ctypes
messages: 387933
nosy: hrnciar, hroncok
priority: normal
severity: normal
status: open
title: ctypes: test_frozentable fails when make regen-frozen
type: compile error
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43372>
_______________________________________


More information about the New-bugs-announce mailing list