Closed
Description
BPO | 43073 |
---|---|
Nosy | @MrSurly |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = None
closed_at = None
created_at = <Date 2021-01-30.04:38:58.603>
labels = ['ctypes', '3.8']
title = 'Adding a ctypes.Union to a ctypes.BigEndianStructure results in an error'
updated_at = <Date 2021-11-07.14:24:54.167>
user = 'https://github.com/MrSurly'
bugs.python.org fields:
activity = <Date 2021-11-07.14:24:54.167>
actor = 'rindeal'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['ctypes']
creation = <Date 2021-01-30.04:38:58.603>
creator = 'MrSurly'
dependencies = []
files = []
hgrepos = []
issue_num = 43073
keywords = []
message_count = 2.0
messages = ['385970', '405906']
nosy_count = 2.0
nosy_names = ['MrSurly', 'rindeal']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = None
url = 'https://bugs.python.org/issue43073'
versions = ['Python 3.8']
Activity
MrSurly commentedon Jan 30, 2021
Placing a ctypes.Union inside of a ctypes.BigEndianStructure results in "TypeError: This type does not support other endian". I believe this is a similar problem to issue bpo-4376 (https://bugs.python.org/issue4376)
Minimum repro test case:
I believe the fix is similar to that issue, though I admit I don't know enough about this code to be sure.
rindeal commentedon Nov 7, 2021
I have created a workaround, since it might take years to fix this in master. Hope it'll come in useful.
For the example in https://bugs.python.org/issue43073#msg385970, but probably any combination of Unions and BigEndianStructures can be constructed this way.
encukou commentedon May 13, 2025
This works in Python 3.11; presumably due to #25480.