Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34.3k
[3.14] gh-146056: Fix repr() for lists and tuples containing NULLs (GH-146129) (alt)#146204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -497,6 +497,14 @@ PyAPI_FUNC(int) PyUnicodeWriter_WriteStr( | ||
| PyAPI_FUNC(int) PyUnicodeWriter_WriteRepr( | ||
| PyUnicodeWriter *writer, | ||
| PyObject *obj); | ||
| PyAPI_FUNC(int) _PyUnicodeWriter_WriteReprTrue( | ||
| PyUnicodeWriter *writer, | ||
| PyObject *obj); | ||
| #if defined(Py_BUILD_CORE) || defined(Py_BUILD_CORE_MODULE) | ||
| #define PyUnicodeWriter_WriteRepr _PyUnicodeWriter_WriteReprTrue | ||
| #endif | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. It looks like a bad hack to me. I don't think that it's needed: only tuple_repr() and list_repr() should be modified to accept NULL:#146155 (comment), other functions cannot call PyUnicodeWriter_WriteRepr() with NULL. MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I tried to minimize the diff. If you prefer, we can simply replace We cannot be sure that this is not needed until we analyze every use of | ||
| PyAPI_FUNC(int) PyUnicodeWriter_WriteSubstring( | ||
| PyUnicodeWriter *writer, | ||
| PyObject *str, | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Fix :meth:`!list.__repr__` for lists containing ``NULL``\ s. |
Uh oh!
There was an error while loading.Please reload this page.