Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

PyArg_ParseTuple(args, "u#", ...) misbehaves with -Werror #94864

Closed
Assignees
serhiy-storchaka
Labels
3.10only security fixes3.11only security fixes
@jwilk

Description

@jwilk

PyArg_ParseTuple(args, "u#", ...) generates a deprecation warning, as expected:

$python3 --versionPython 3.11.0b4$python3 -c'import _testcapi as t; t.getargs_u_hash("")'<string>:1: DeprecationWarning: getargs: The 'u' format is deprecated. Use 'U' instead.

But when I turn warnings into exceptions, something weird happens:

$python3 -Werror -c'import _testcapi as t; t.getargs_u_hash("")'Traceback (most recent call last):  File "<string>", line 1, in <module>ValueError: character U+b4000360 is not in range [U+0000; U+10ffff]

What's going on here? The code forgetargs_u_hash() looks like this:

Py_UNICODE*str;Py_ssize_tsize;if (!PyArg_ParseTuple(args,"u#",&str,&size))returnNULL;returnPyUnicode_FromWideChar(str,size);

So it looks likePyArg_ParseTuple() returns true, but leavesstr andsize uninitialized.

Metadata

Metadata

Labels

3.10only security fixes3.11only security fixes

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2026 Movatter.jp