Issue #50 resolved

Crash when comparing kLSSharedFileListItemLast to self

Kunal Parmar
created an issue
>>> from LaunchServices import kLSSharedFileListItemLast
>>> kLSSharedFileListItemLast == kLSSharedFileListItemLast
Segmentation fault: 11

I'm using a mocking library (mox) to test that my code is calling LSSharedFileListInsertItemURL function with the correct parameters.

Comments (3)

  1. Ronald Oussoren repo owner

    The root cause of the crash is that the C object "kLSSharedFileListItemLast" is not a real object reference, PyObjC knows this but doesn't guard against accessing the object state.

    The code above crashes because this calls the __eq__ method, which tries to forward to the corresponding Objective-C method and that fails because "kLSSharedFileListItemLast" isn't actually an object in C.

    dir(kLSSharedFileListItemLast) fails in the same way.

  2. Log in to comment