After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 537554 - Hangs when file goes missing
Hangs when file goes missing
Status: RESOLVED FIXED
Product: postr
Classification: Other
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Postr Maintainers
Postr Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-06-10 10:33 UTC by Thomas Wood
Modified: 2010-12-02 01:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix the bug (2.12 KB, patch)
2009-11-06 22:39 UTC, Germán Poo-Caamaño
rejected Details | Review
patch (1.33 KB, patch)
2009-11-07 02:56 UTC, Francisco Rojas
needs-work Details | Review
patch (7.27 KB, application/octet-stream)
2010-06-17 15:05 UTC, Francisco Rojas
  Details
patch master compatible (8.68 KB, patch)
2010-09-13 00:48 UTC, Francisco Rojas
committed Details | Review

Description Thomas Wood 2008-06-10 10:33:55 UTC
Postr hangs if a file has been added that is subsequently missing when it comes to uploading.

Traceback (most recent call last):
  • File "/var/lib/python-support/python2.5/postr/postr.py", line 450 in on_upload_activate
    self.upload()
  • File "/var/lib/python-support/python2.5/postr/postr.py", line 821 in upload
    is_public=is_public, is_family=is_family, is_friend=is_friend)
  • File "/var/lib/python-support/python2.5/postr/flickrest.py", line 193 in upload
    kwargs['photo'] = file(filename, "rb")
IOError: [Errno 2] No such file or directory: '/home/thomas/Desktop/20080608_154254-1.jpg'

Comment 1 Germán Poo-Caamaño 2009-11-05 03:05:57 UTC
Easy to reproduce it.  The upload progress window stays there.
Comment 2 Germán Poo-Caamaño 2009-11-06 22:39:08 UTC
Created attachment 147134 [details] [review]
Fix the bug
Comment 3 Germán Poo-Caamaño 2009-11-06 23:05:15 UTC
Comment on attachment 147134 [details] [review]
Fix the bug

I uploaded the wrong patch.
Comment 4 Francisco Rojas 2009-11-07 02:56:26 UTC
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.
Comment 5 Germán Poo-Caamaño 2009-11-08 23:56:31 UTC
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.
Comment 6 Francisco Rojas 2010-06-17 15:05:49 UTC
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.
Comment 7 Germán Poo-Caamaño 2010-08-22 07:54:21 UTC
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.
Comment 8 Francisco Rojas 2010-09-13 00:48:16 UTC
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
Comment 9 Germán Poo-Caamaño 2010-12-02 01:22:48 UTC
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.
Comment 10 Germán Poo-Caamaño 2010-12-02 01:23:18 UTC
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.