Skip to content

Not all C tests conform to PEP-737 #136300

Open
@wsfulton

Description

@wsfulton

Bug report

Bug description:

A few C tests do not conform to PEP-737 in that they don't:

  • Use %T format specifier instead of %s and Py_TYPE(x)->tp_name.
  • Use legacy %.200s format specifier for truncating type names.

Example patch that needs applying:

    PyErr_Format(PyExc_TypeError,
-        "cannot index memory using \"%.200s\"",
-        Py_TYPE(key)->tp_name);
+        "cannot index memory using \"%T\"",
+        key);

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dirtype-refactorCode refactoring (with no changes in behavior)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions