Skip to content

Commit e4be205

Browse files
miss-islingtonsth
andauthored
bpo-36251: Fix format strings used in match_repr() and stdprinter_repr(). (GH-12252)
(cherry picked from commit 8b91eda) Co-authored-by: sth <sth.dev@tejp.de>
1 parent e5123d8 commit e4be205

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
@@ -2319,7 +2319,7 @@ match_repr(MatchObject *self)
23192319
if (group0 == NULL)
23202320
return NULL;
23212321
result = PyUnicode_FromFormat(
2322-
"<%s object; span=(%d, %d), match=%.50R>",
2322+
"<%s object; span=(%zd, %zd), match=%.50R>",
23232323
Py_TYPE(self)->tp_name,
23242324
self->mark[0], self->mark[1], group0);
23252325
Py_DECREF(group0);

Objects/fileobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ stdprinter_fileno(PyStdPrinter_Object *self)
407407
static PyObject *
408408
stdprinter_repr(PyStdPrinter_Object *self)
409409
{
410-
return PyUnicode_FromFormat("<stdprinter(fd=%d) object at 0x%x>",
410+
return PyUnicode_FromFormat("<stdprinter(fd=%d) object at %p>",
411411
self->fd, self);
412412
}
413413

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