GNOME Bugzilla – Bug 537554
Hangs when file goes missing
Last modified: 2010-12-02 01:23:18 UTC
Postr hangs if a file has been added that is subsequently missing when it comes to uploading. Traceback (most recent call last):
+ Trace 200009
self.upload()
is_public=is_public, is_family=is_family, is_friend=is_friend)
kwargs['photo'] = file(filename, "rb")
Easy to reproduce it. The upload progress window stays there.
Created attachment 147134 [details] [review] Fix the bug
Comment on attachment 147134 [details] [review] Fix the bug I uploaded the wrong patch.
Created attachment 147154 [details] [review] patch The previous patch is necessary, but I think it's also good throw a error message and stop the upload process if this error happens.
Review of attachment 147154 [details] [review]: It is right to check it before upload the picture, but it could be better give a better feedback to the user, such as, adding an emblem or mark over the picture (or anything else) that show the missing picture can not be uploaded. ::: src/postr.py @@ +871,3 @@ + % filename) + d.show_all() + self.upload_done() If there are several photos queued, the upload process will be stopped by the one missing. What if there next 5 ones were deleted too? It will be necessary to run 5 times the upload in order to realize it. @@ +872,3 @@ + d.show_all() + self.upload_done() + self.thumbview.get_model().remove(it) Instead of removing, we could use an emblem/attribute to show the image is not there anymore. And we can skip any missing picture when uploading. In case there are several pictures missing, it would avoid several error dialogs and still provide the feedback to the user about the error.
Created attachment 163927 [details] patch Save a list of all the image that it couldn't upload. Once the upload process is done, the missing images are left in the TreeView and adds an emblem over the pictures. Also throw a error message. I'm not sure about the message in the dialog. should it contain more information? perhaps should contain which are the missing images or the missing images with his gio.Error message. But I thought it could be overwhelming to the user see all this info if many images are missing. Maybe we should make a new error dialog with gtk.Expander() widget on it to show this information.
Francisco, The patch does not apply in master. It seems it applies against 0.12. May you update it? On the other hand, the idea of the expander seems reasonable to me.
Created attachment 170105 [details] [review] patch master compatible now does apply to master and also I added into the error dialog the images that have failed this patch it's also applied in my own branch http://gitorious.org/~frojasg/postr/frojasgs-postr
Review of attachment 170105 [details] [review]: Thanks Francisco. I applied the patch to master. Just for future reference: this patch solves the problem but it does not show the path of the original file. I think it is ok for the most common uses cases.
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.