[3.8] bpo-39016: type_mro_modified produces negative refcount#17555
[3.8] bpo-39016: type_mro_modified produces negative refcount#17555ctismer wants to merge 1 commit intopython:3.8from pyside:3.8-refcount
Conversation
It the "if (custom) {" branch, lookup_maybe_method, which uses
borrowed references, is not handled correctly.
Solved by removing all PyXDECREF calls.
|
@ctismer Can you open the PR against master instead? We will backport the change to 3.8 after is merged. |
|
No guys, this "if (custom)" part is only in the 3.8 branch. |
Yeah, apologies for the confusion. I answered in the issue as well. This still needs a NEWS entry and ideally a test. |
Would it make any sense to reuse master code in 3.8? |
No idea. I was not aware that 3.8 and master diverge that much. Should the "if (custom) {" clause perhaps be adjusted/removed like in master? Update: master is probably a bit behind Python 3.8, see the comment in type_mro_modified. So I would probably use the corrected 3.8 version (no Py_XDECREF's) and apply it to master as well. It was a change by Julien Palard from 2019-05-26, 180dc1b |
|
@JulienPalard, can you shed some light why your change only went into 3.8 and not into master? |
|
There's some misunderstanding there? |
|
Unfortunately, this isn't the right fix :( |
|
Sorry, I believe that I was mislead and thought that lookup_maybe_method returns a borrowed reference. This was a mistake, _PyType_Lookup returns a borrowed reference. Closing the issue so far :-( |
In the "if (custom) {" branch, lookup_maybe_method, which uses
borrowed references, is not handled correctly.
Solved by removing all PyXDECREF calls.
https://bugs.python.org/issue39016