Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Lib/logging/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

Copyright (C) 2001-2022 Vinay Sajip. All Rights Reserved.

To use, simply 'import logging' and log away!
To use, simply 'import logging.config' and log away!
"""

import errno
Expand Down
6 changes: 3 additions & 3 deletions Lib/pydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1355,7 +1355,7 @@ def docmodule(self, object, name=None, mod=None, *ignored):
if data:
contents = []
for key, value in data:
contents.append(self.docother(value, key, name, maxlen=70))
contents.append(self.docother(value, key, name, maxlen=76))
result = result + self.section('DATA', '\n'.join(contents))

if version := self._get_version(object):
Expand Down Expand Up @@ -1478,7 +1478,7 @@ def spilldata(msg, attrs, predicate):
obj = getattr(object, name)
except AttributeError:
obj = homecls.__dict__[name]
push(self.docother(obj, name, mod, maxlen=70, doc=doc) +
push(self.docother(obj, name, mod, maxlen=72, doc=doc) +
'\n')
return attrs

Expand Down Expand Up @@ -1629,7 +1629,7 @@ def docother(self, object, name=None, mod=None, parent=None, *ignored,
if maxlen:
line = (name and name + ' = ' or '') + repr
chop = maxlen - len(line)
if chop < 0: repr = repr[:chop] + '...'
if chop < 0: repr = repr[:chop-3] + '...'
line = (name and self.bold(name) + ' = ' or '') + repr
if not doc:
doc = getdoc(object)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix memory leak when using the :ref:`mimalloc memory allocator <mimalloc>`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
:mod:`pydoc` now uses all available space (80 columns) for formatting reprs
of module and class data, but ensure that they do not overflow.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Avoid possible memory leak in ``tkinter.c`` on Windows.
15 changes: 10 additions & 5 deletions Modules/_tkinter.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,18 +128,20 @@ _get_tcl_lib_path(void)
}

/* Check expected location for an installed Python first */
tcl_library_path = PyUnicode_FromString("\\tcl\\tcl" TCL_VERSION);
if (tcl_library_path == NULL) {
PyObject* tmp_tcl_library_path = PyUnicode_FromString("\\tcl\\tcl" TCL_VERSION);
if (tmp_tcl_library_path == NULL) {
Py_DECREF(prefix);
return NULL;
}
tcl_library_path = PyUnicode_Concat(prefix, tcl_library_path);
tcl_library_path = PyUnicode_Concat(prefix, tmp_tcl_library_path);
Py_DECREF(tmp_tcl_library_path);
Py_DECREF(prefix);
if (tcl_library_path == NULL) {
return NULL;
}
stat_return_value = _Py_stat(tcl_library_path, &stat_buf);
if (stat_return_value == -2) {
Py_DECREF(tcl_library_path);
return NULL;
}
if (stat_return_value == -1) {
Expand All @@ -154,16 +156,17 @@ _get_tcl_lib_path(void)
}
stat_return_value = _Py_stat(tcl_library_path, &stat_buf);
if (stat_return_value == -2) {
Py_DECREF(tcl_library_path);
return NULL;
}
if (stat_return_value == -1) {
/* tcltkDir for a repository build doesn't exist either,
reset errno and leave Tcl to its own devices */
errno = 0;
tcl_library_path = NULL;
Py_CLEAR(tcl_library_path);
}
#else
tcl_library_path = NULL;
Py_CLEAR(tcl_library_path);
#endif
}
already_checked = 1;
Expand Down Expand Up @@ -707,11 +710,13 @@ Tkapp_New(const char *screenName, const char *className,
if (!ret && GetLastError() == ERROR_ENVVAR_NOT_FOUND) {
str_path = _get_tcl_lib_path();
if (str_path == NULL && PyErr_Occurred()) {
Py_DECREF(v);
return NULL;
}
if (str_path != NULL) {
utf8_path = PyUnicode_AsUTF8String(str_path);
if (utf8_path == NULL) {
Py_DECREF(v);
return NULL;
}
Tcl_SetVar(v->interp,
Expand Down
6 changes: 3 additions & 3 deletions Objects/mimalloc/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ mi_heap_t* _mi_heap_main_get(void) {

// note: in x64 in release build `sizeof(mi_thread_data_t)` is under 4KiB (= OS page size).
typedef struct mi_thread_data_s {
mi_heap_t heap; // must come first due to cast in `_mi_heap_done`
mi_heap_t heap; // must come first due to cast in `_mi_heap_done`
mi_tld_t tld;
mi_memid_t memid;
mi_memid_t memid; // must come last due to zero'ing
} mi_thread_data_t;


Expand Down Expand Up @@ -231,7 +231,7 @@ static mi_thread_data_t* mi_thread_data_zalloc(void) {
}

if (td != NULL && !is_zero) {
_mi_memzero_aligned(td, sizeof(*td));
_mi_memzero_aligned(td, offsetof(mi_thread_data_t,memid));
}
return td;
}
Expand Down
Loading