Skip to content

[3.14] gh-146056: Fix list.__repr__() for lists containing NULLs (GH-146129)#146155

Open
serhiy-storchaka wants to merge 1 commit intopython:3.14from
serhiy-storchaka:backport-0f2246b-3.14
Open

[3.14] gh-146056: Fix list.__repr__() for lists containing NULLs (GH-146129)#146155
serhiy-storchaka wants to merge 1 commit intopython:3.14from
serhiy-storchaka:backport-0f2246b-3.14

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Mar 19, 2026

pythonGH-146129)

(cherry picked from commit 0f2246b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Call :c:func:`PyObject_Repr` on *obj* and write the output into *writer*.
If *obj* is ``NULL``, write the string ``"<NULL>"`` into *writer*.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to not change PyUnicodeWriter_WriteRepr() in a Python 3.14.x bugfix release. Can you leave it unchanged? Instead, modify list_repr() and tuple_repr() to write <NULL> string explicitly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants