Skip to content

Commit 8b91eda

Browse files
sthserhiy-storchaka
authored andcommitted
bpo-36251: Fix format strings used in match_repr() and stdprinter_repr(). (GH-12252)
1 parent ca7fe50 commit 8b91eda

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix format strings used for stderrprinter and re.Match reprs. Patch by
2+
Stephan Hohe.

Modules/_sre.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2306,7 +2306,7 @@ match_repr(MatchObject *self)
23062306
if (group0 == NULL)
23072307
return NULL;
23082308
result = PyUnicode_FromFormat(
2309-
"<%s object; span=(%d, %d), match=%.50R>",
2309+
"<%s object; span=(%zd, %zd), match=%.50R>",
23102310
Py_TYPE(self)->tp_name,
23112311
self->mark[0], self->mark[1], group0);
23122312
Py_DECREF(group0);

Objects/fileobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ stdprinter_fileno(PyStdPrinter_Object *self, PyObject *Py_UNUSED(ignored))
411411
static PyObject *
412412
stdprinter_repr(PyStdPrinter_Object *self)
413413
{
414-
return PyUnicode_FromFormat("<stdprinter(fd=%d) object at 0x%x>",
414+
return PyUnicode_FromFormat("<stdprinter(fd=%d) object at %p>",
415415
self->fd, self);
416416
}
417417

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy