Stefan Krah <ste...@bytereef.org> added the comment:

Okay, in memoryview the cast tests can trigger UB checks. memoryview assumes 
that bool is packed correctly, so just casting does not work.
Casting anything to bool is of course a bit silly anyway.

diff --git a/Lib/test/test_buffer.py b/Lib/test/test_buffer.py
index 6178ffde7a..86cf4c309f 100644
--- a/Lib/test/test_buffer.py
+++ b/Lib/test/test_buffer.py
@@ -2758,6 +2758,8 @@ class TestBufferProtocol(unittest.TestCase):
                 tsize = struct.calcsize(tfmt)
                 n = prod(_tshape) * tsize
                 obj = 'memoryview' if is_byte_format(tfmt) else 'bytefmt'
+                if "?" in tfmt:
+                    continue
                 for fmt, items, _ in iter_format(n, obj):
                     size = struct.calcsize(fmt)
                     shape = [n] if n > 0 else []

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39689>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to