ui.py can run into uncaught ConverterQueueCanceled exception

Bug #1121192 reported by Michael Schwendt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SoundConverter
Fix Released
Critical
GautierPortet

Bug Description

https://bugzilla.redhat.com/909681

ui.py tags_read() and read_tags() both call gstreamer.py converter.add(sound_file), which throws ConverterQueueCanceled, e.g. when running into files that exist already (it opens a dialog then, too). Since ui.py doesn't catch that exception, SoundConverter can crash.

Revision history for this message
Michael Schwendt (mschwendt) wrote :

The crucial one is tags_read() which is called via idle callback. It might even run into ConverterQueueError, too. And if the user wants to cancel the conversion during this "Reading tags..." stage, it would be necessary to forward that decision via some flag to ui.py do_convert()

Revision history for this message
Michael Schwendt (mschwendt) wrote :

Steps to reproduce (with Fedora 18 which doesn't suffer from the idle call issues):

1) start SoundConverter
2) visit Preferences and choose a test target folder and a naming pattern that depends on tags, e.g. "Artist - title"
3) add a folder of input files, e.g. 10 files
4) start conversion

So far so good.

5) restart SoundConverter, or use "Clear"
6) add the same folder of input files
7) start conversion

This time, when reading tags, it will run into target files that exist already. Try the "Cancel" button. Watch terminal ouput (the uncaught exception). Try the "Apply to entire queue" checkbox together with Cancel. It will be ignored.

Revision history for this message
Michael Schwendt (mschwendt) wrote :

Since I've been distracted by the major issues running on Fedora 19 development, here's just the patch that forwards the exceptions to the main loop. With it, user may cancel conversion during tag reading.

Changed in soundconverter:
assignee: nobody → GautierPortet (kassoulet)
Revision history for this message
GautierPortet (kassoulet) wrote :

Good catch, as always!

To fix this issue, since the non-catched exceptions are only used by ConverterQueue.add to return an error, it's easier to just return an error code and we're done.

Revision history for this message
Michael Schwendt (mschwendt) wrote :

Not sure how you would achieve that. See comment 1. ui.py tags_read() is an idle callback method.

Revision history for this message
GautierPortet (kassoulet) wrote :
Changed in soundconverter:
status: New → Fix Committed
importance: Undecided → Critical
milestone: none → 2.0.5
Changed in soundconverter:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.