Patch for possible resolution of https://bugs.kde.org/show_bug.cgi?id=416037
ClosedPublic

Authored by paolini on Jan 9 2020, 5:44 PM.

Details

Summary

After transition python2 -> python3 a crash is experienced when closing kig in case an object is create via python scripting.

Diff Detail

Repository
R331 Kig
Lint
Lint Skipped
Unit
Unit Tests Skipped
paolini created this revision.Jan 9 2020, 5:44 PM
Restricted Application added a project: KDE Edu. · View Herald TranscriptJan 9 2020, 5:44 PM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
paolini requested review of this revision.Jan 9 2020, 5:44 PM

Looks reasonable.

But I am not sure about the comment, i.e., whether the Kig maintainer(s) want this kind of verbose documentation in the code (as opposed to in the commit history only) or not. (I guess it mostly depends on how likely somebody is to accidentally change it back if the comment is missing.)

paolini updated this revision to Diff 73166.Jan 10 2020, 12:02 AM

Removed comments

Since I forgot to mention, this is a patch agains bug #416037

wbauer added a subscriber: wbauer.Jan 16 2020, 7:58 PM
wbauer added inline comments.
scripting/python_scripter.cc
431

This breaks the build with python2 though.

Maybe add a conditional like it's done in https://cgit.kde.org/kig.git/commit/?id=c0aa768f28219ce8b3c275a6d13ad69757e3c7af ?

paolini added inline comments.Jan 16 2020, 11:17 PM
scripting/python_scripter.cc
431

Actually Py_Finalze() should still work for compatibility reasons in python3, so we could simply
substitute Py_FinalizeEx() with Py_Finalize()

wbauer added inline comments.Jan 17 2020, 2:37 PM
scripting/python_scripter.cc
431

I saw now that Py_FinalizeEx() exists only since python version 3.6.
So this should be changed anyway, even if we don't care for python2 anymore.

But yes, it's probably best to just switch back to Py_Finalize(), I suppose. The return value is not checked anyway.

paolini updated this revision to Diff 73809.Jan 18 2020, 5:43 AM

Going back to original Py_Finalize() to maintain compatibility with pithon2 and earlier versions of python3

This revision was not accepted when it landed; it landed in state Needs Review.Jan 18 2020, 6:18 AM
This revision was automatically updated to reflect the committed changes.