[New-bugs-announce] [issue38579] 'u' formatted arrays mostly prevent appends of 4 byte characters

Dan Snider report at bugs.python.org
Thu Oct 24 06:31:24 EDT 2019


New submission from Dan Snider <mr.assume.away at gmail.com>:

Unicode characters with code points above u+ffff can only be added to the end of an array, and only from a call to the "fromunicode" method. This is because "fromunicode" uses a different procedure to modify the array compared to __new__, __setitem__, append, and extend array methods, all of which eventually call u_setitem routine, which calls PyArg_Parse with a format spec of "u#". The error occurs in that call, from what at first glance appears to be an incorrect length determination for unicode objects of the 4 byte kind.

----------
components: Library (Lib)
messages: 355319
nosy: bup
priority: normal
severity: normal
status: open
title: 'u' formatted arrays mostly prevent appends of 4 byte characters
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8

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


More information about the New-bugs-announce mailing list