Skip to content

Commit 535a297

Browse files
committed
Merge branch 'master' into remove-unknown_format
2 parents 94d7061 + b446092 commit 535a297

13 files changed

Lines changed: 100 additions & 36 deletions

File tree

.github/workflows/new-bugs-announce-notifier.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
// We need to truncate the body size, because the max size for
4545
// the whole payload is 16kb. We want to be safe and assume that
4646
// body can take up to ~8kb of space.
47-
body : issue.data.body.substring(0, 8000)
47+
body : (issue.data.body || "").substring(0, 8000)
4848
};
4949
5050
const data = {

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ Tools/unicode/data/
137137
/config.status
138138
/config.status.lineno
139139
/.ccache
140-
/cross-build/
140+
/cross-build*/
141141
/jit_stencils*.h
142142
/platform
143143
/profile-clean-stamp

Doc/tutorial/introduction.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,11 @@ If you don't want characters prefaced by ``\`` to be interpreted as
184184
special characters, you can use *raw strings* by adding an ``r`` before
185185
the first quote::
186186

187-
>>> print('C:\some\name') # here \n means newline!
188-
C:\some
187+
>>> print('C:\this\name') # here \t means tab, \n means newline
188+
C: his
189189
ame
190-
>>> print(r'C:\some\name') # note the r before the quote
191-
C:\some\name
190+
>>> print(r'C:\this\name') # note the r before the quote
191+
C:\this\name
192192

193193
There is one subtle aspect to raw strings: a raw string may not end in
194194
an odd number of ``\`` characters; see

Lib/test/test_struct.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,8 @@ def test_operations_on_half_initialized_Struct(self):
836836
self.assertRaises(RuntimeError, S.unpack, spam)
837837
self.assertRaises(RuntimeError, S.unpack_from, spam)
838838
self.assertRaises(RuntimeError, getattr, S, 'format')
839+
self.assertRaises(RuntimeError, S.__sizeof__)
840+
self.assertRaises(RuntimeError, repr, S)
839841
self.assertEqual(S.size, -1)
840842

841843

Lib/test/test_tools/test_compute_changes.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ def test_ci_fuzz_stdlib(self):
5454
f = p / "file"
5555
elif p.is_file():
5656
f = p
57+
else:
58+
self.fail(f"LIBRARY_FUZZER_PATHS contains an invalid entry: {p!r}")
5759
result = process_changed_files({f})
5860
self.assertTrue(result.run_ci_fuzz_stdlib)
5961
self.assertTrue(is_fuzzable_library_file(f))
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Make :meth:`!mmap.mmap.set_name` thread-safe on the :term:`free threaded <free
2+
threading>` build.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fix crash in :mod:`struct` when calling :func:`repr` or
2+
``__sizeof__()`` on an uninitialized :class:`struct.Struct`
3+
object created via ``Struct.__new__()`` without calling ``__init__()``.

Modules/_queuemodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ RingBuf_Put(RingBuf *buf, PyObject *item)
165165
// Buffer is full, grow it.
166166
if (resize_ringbuf(buf, buf->items_cap * 2) < 0) {
167167
PyErr_NoMemory();
168+
Py_DECREF(item);
168169
return -1;
169170
}
170171
}

Modules/_struct.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2382,6 +2382,7 @@ static PyObject *
23822382
Struct___sizeof___impl(PyStructObject *self)
23832383
/*[clinic end generated code: output=2d0d78900b4cdb4e input=faca5925c1f1ffd0]*/
23842384
{
2385+
ENSURE_STRUCT_IS_READY(self);
23852386
size_t size = _PyObject_SIZE(Py_TYPE(self)) + sizeof(formatcode);
23862387
for (formatcode *code = self->s_codes; code->fmtdef != NULL; code++) {
23872388
size += sizeof(formatcode);
@@ -2393,6 +2394,7 @@ static PyObject *
23932394
s_repr(PyObject *op)
23942395
{
23952396
PyStructObject *self = PyStructObject_CAST(op);
2397+
ENSURE_STRUCT_IS_READY(self);
23962398
PyObject* fmt = PyUnicode_FromStringAndSize(
23972399
PyBytes_AS_STRING(self->s_format), PyBytes_GET_SIZE(self->s_format));
23982400
if (fmt == NULL) {

Modules/clinic/mmapmodule.c.h

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)