sugarlabs / sugar

Sugar GTK shell
GNU General Public License v3.0
252 stars 240 forks source link

Fix Issue #856 with Emit Function Parameter Datatype during Object Deletion Signal. #967

Closed bhavyabansal9068 closed 1 year ago

bhavyabansal9068 commented 1 year ago

@chimosky @quozl Fix Issue #856 with Emit Function Parameter Datatype during Object Deletion signal.

Root Cause: Previously, the 'int' datatype was used as an argument for the emit function when an object was deleted. This meant that the Python interpreter was responsible for deciding whether to use int32 or int64 based on the type of input initially passed in. Initially, the interpreter was selecting int32, but when larger input values were used, a 'typeerror' occurred because it could not convert int64 to int32 (gint).

Furthermore, the object_id was deleted from the _objects dictionary before this 'typeerror', leading to a 'keyerror' in the next iteration of the code.

Fix Provided: I have changed the datatype of the function parameter to int64, ensuring that integer input is stored as int64 regardless of its range.

chimosky commented 1 year ago

Tested, works as expected. Thanks!

Merged by hand, please review b898aef2 as I edited the commit message.

Also checkout our contributing-doc as it contains helpful info like working on a different branch before opening a PR.