jim-easterbrook / Photini

An easy to use digital photograph metadata (Exif, IPTC, XMP) editing application.
https://photini.readthedocs.io/
GNU General Public License v3.0
157 stars 24 forks source link

Unhandled Python exception #35

Closed ghost closed 6 years ago

ghost commented 6 years ago

In the film strip, right clicking a thumbnail and choosing "Save metadata" crashes the python interpreter:

Unhandled Python exception
Received signal 6
 [0x00011600bdfc]
 [0x00011600bca1]
 [0x7fff745bcf5a]
 [0x00004bd3b490]
...
 [0x000110a27382]
 [0x000110a232bc]
[end of stack trace]
Abort trap: 6

Fix (?): uncomment @safe_slot decorator on save_files(self, images=[]) in imagelist.py.

$ photini --version
Photini 2018.2.0, build 1028 (c6281ac)
  Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 05:52:31) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
  pgi 0.0.11.1, GExiv2 0.10.8, GObject 2.0
  PyQt 5.10.1, Qt 5.10.1, using QtWebEngine
  available styles: macintosh, Windows, Fusion
jim-easterbrook commented 6 years ago

Thanks for finding that. By "uncomment" I think you mean "comment out".

A bit of explanation for anyone interested: Qt doesn't handle Python exceptions at all, so even something as simple as a typing error produces a segfault or an "unhandled exception" crash. The safe_slot decorator is supposed to wrap a method in an exception handler to help track down such bugs. It's not supposed to cause them!

jim-easterbrook commented 6 years ago

In this case save_files can be called from the file menu, with a boolean parameter, or from the context menu, with a list parameter. The safe_slot decorator needs a fixed function signature, so one or both of these calls was incorrect. Commit 70dd20f should fix the problem.