-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-101747: Fix refleak in new OrderedDict
repr
#101748
Conversation
The |
Objects/odictobject.c
Outdated
@@ -1388,6 +1388,7 @@ odict_repr(PyODictObject *self) | |||
|
|||
Done: | |||
Py_ReprLeave((PyObject *)self); | |||
Py_XDECREF(dcopy); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can move it above the Done
label and change Py_XDECREF
to Py_DECREF
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, it might be a slightly more readable! I will wait for all tests to finish and apply it :)
@erlend-aasland it reports:
I think these leaks are not related 🤔 Should I fix it here? |
I prefer one fix per PR; that makes it easier to bisect in case something goes wrong, and it also makes for a cleaner git history. |
@erlend-aasland then I consider this done:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
I will merge this PR after waiting for @serhiy-storchaka approval
I can not reproduce the issue on my macOS. It sounds like we have to debug on the RHEL machine. |
* main: Fix some typos in asdl_c.py (pythonGH-101757) pythongh-101747: Fix refleak in new `OrderedDict` repr (pythonGH-101748) pythongh-101430: Update tracemalloc to handle presize properly. (pythongh-101745) pythonGH-101228: Fix typo in docstring for read method of `_io.TextIOWrapper` class (python#101227) Fix typo in `test_fstring.py` (python#101600) pythongh-101726: Update the OpenSSL version to 1.1.1t (pythonGH-101727) pythongh-101283: Fix 'versionchanged' for the shell=True fallback on Windows in 3.12 (pythonGH-101728) LibFFI build requires x64 Cygwin, and skip the ARM build (pythonGH-101743)
After:
./python.exe -m test -v test_ordered_dict -R 3:3
OrderedDict
repr #101747