New submission from Serhiy Storchaka:

>>> from ctypes import *
>>> class POINT(Structure):
...     _fields_ = [("x", c_int), ("y", c_int)]
... 
>>> POINT(2, 3, x=4)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: duplicate values for field '???'

The name of conflicting field is not output correctly because it is expected to 
be bytes.

Proposed patch makes the error message always contain the name of conflicting 
field.

----------
components: Library (Lib), ctypes
files: ctypes_conflictin_initializers_error_message.patch
keywords: patch
messages: 268713
nosy: amaury.forgeotdarc, belopolsky, meador.inge, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Incorrect error message for conflicting initializers of ctypes structure
type: behavior
versions: Python 3.5, Python 3.6
Added file: 
http://bugs.python.org/file43430/ctypes_conflictin_initializers_error_message.patch

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

Reply via email to