Opened 14 years ago

Closed 13 years ago

#1278 closed bug (Fixed)

"Move storage" in deluge-gtk doesn't work

Reported by: simonbcn Owned by: Cas
Priority: critical Milestone: 1.3.2
Component: GTK UI Version: 1.3.0_dev
Keywords: Cc:

Description

deluge-gtk + remote deluged
Error in console:

Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/deluge-1.3.900_dev-py2.6.egg/deluge/ui/gtkui/menubar.py", line 353, in _on_response_event
    log.debug("Moving torrents to %s", entry.get_text())
NameError: free variable 'entry' referenced before assignment in enclosing scope

Change History (12)

comment:1 Changed 14 years ago by simonbcn

I have verified that this does not happen always, sometimes it works well... ?_?

comment:2 Changed 14 years ago by simonbcn

Please, can you fix this? It's very annoying and, when this occurs, it's impossible work with gtk-ui.

comment:3 Changed 14 years ago by negge

I don't know if it's exactly related to this as I don't currently log the output from deluged, but I know for a fact that you cannot use the "Move storage" feature if the file/folder you're moving or the location you're moving to contains Scandinavian characters (åäö).

comment:4 Changed 13 years ago by Cas

  • Resolution set to fixed
  • Status changed from new to closed

i am closing this bug as i see no problems with 1.3 releases.

negge: if your bug still exists could you create a new ticket with details please

comment:5 Changed 13 years ago by negge

Actually I just lended my spare harddrive to a friend so I can't test with another filesystem at the moment. I will re-open this bug if I find that switching filesystems doesn't work.

comment:6 Changed 13 years ago by Cas

negge please see #1373 as i think this is the same as your problem.

comment:7 Changed 13 years ago by s0undt3ch

  • Milestone changed from Future to 1.3.2
  • Resolution fixed deleted
  • Status changed from closed to reopened

I've hit this bug too:

[DEBUG   ] 19:33:12 gtkui:267 sent: 7.3 MiB recv: 37.7 MiB
[DEBUG   ] 19:33:12 gtkui:275 sent rate: 8.5 KiB/s recv rate: 16.8 KiB/s
[DEBUG   ] 19:33:22 gtkui:267 sent: 7.3 MiB recv: 37.9 MiB
[DEBUG   ] 19:33:22 gtkui:275 sent rate: 8.4 KiB/s recv rate: 16.6 KiB/s
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/deluge/ui/gtkui/menubar.py", line 351, in _on_response_event
    dialog.hide()
NameError: free variable 'dialog' referenced before assignment in enclosing scope
[DEBUG   ] 19:33:32 gtkui:267 sent: 7.4 MiB recv: 38.1 MiB
[DEBUG   ] 19:33:32 gtkui:275 sent rate: 8.4 KiB/s recv rate: 16.8 KiB/s
[DEBUG   ] 19:33:42 gtkui:267 sent: 7.5 MiB recv: 38.2 MiB
[DEBUG   ] 19:33:42 gtkui:275 sent rate: 8.5 KiB/s recv rate: 16.6 KiB/s

This happens both in the deluge ppa package and in master. The torrent being moved only has ascii chars.

comment:8 Changed 13 years ago by Cas

Please describe exactly how to reproduce this error

comment:9 follow-up: Changed 13 years ago by Cas

  • Milestone changed from 1.3.2 to Future
  • Status changed from reopened to pending

I think this is a pygtk problem, maybe this one: https://bugzilla.gnome.org/show_bug.cgi?id=546802

The piece of code referenced has not been altered in 3 years and has no obvious errors in it.

For reference I run Ubuntu 10.10 and my version of python-gobject is 2.21.5

comment:10 in reply to: ↑ 9 Changed 13 years ago by s0undt3ch

  • Milestone changed from Future to 1.3.2

Replying to Cas:

I think this is a pygtk problem, maybe this one: https://bugzilla.gnome.org/show_bug.cgi?id=546802

The piece of code referenced has not been altered in 3 years and has no obvious errors in it.

For reference I run Ubuntu 10.10 and my version of python-gobject is 2.21.5

Issue is still present in current maverick. What's needed is keep it referenced, here's a proposed patch:

  • deluge/ui/gtkui/menubar.py

    diff --git a/deluge/ui/gtkui/menubar.py b/deluge/ui/gtkui/menubar.py
    index ce80e54..73fc5a1 100644
    a b def show_move_storage_dialog(self, status): 
    341341        glade = gtk.glade.XML( 
    342342                pkg_resources.resource_filename("deluge.ui.gtkui", 
    343343                                                "glade/move_storage_dialog.glade")) 
    344         dialog = glade.get_widget("move_storage_dialog") 
    345         dialog.set_transient_for(self.window.window) 
    346         entry = glade.get_widget("entry_destination") 
    347         entry.set_text(status["save_path"]) 
     344        self.move_storage_dialog = glade.get_widget("move_storage_dialog") 
     345        self.move_storage_dialog.set_transient_for(self.window.window) 
     346        self.move_storage_dialog_entry = glade.get_widget("entry_destination") 
     347        self.move_storage_dialog_entry.set_text(status["save_path"]) 
    348348        def _on_response_event(widget, response_id): 
     349            def core_responded(*args): 
     350                # Delete references 
     351                del self.move_storage_dialog_entry 
     352                del self.move_storage_dialog 
    349353            if response_id == gtk.RESPONSE_OK: 
    350354                log.debug("Moving torrents to %s", entry.get_text()) 
    351                 path = entry.get_text() 
    352                 client.core.move_storage(component.get("TorrentView").get_selected_torrents(), path) 
    353             dialog.hide() 
    354         dialog.connect("response", _on_response_event) 
    355         dialog.show() 
     355                path = self.move_storage_dialog_entry.get_text() 
     356                client.core.move_storage( 
     357                    component.get("TorrentView").get_selected_torrents(), 
     358                    path 
     359                ).addCallback(core_responded) 
     360            self.move_storage_dialog.hide() 
     361        self.move_storage_dialog.connect("response", _on_response_event) 
     362        self.move_storage_dialog.show() 
     363 
    356364 
    357365    def on_menuitem_queue_top_activate(self, value): 
    358366        log.debug("on_menuitem_queue_top_activate") 

Good enough for commit?

comment:11 Changed 13 years ago by Cas

  • Owner set to Cas
  • Status changed from pending to accepted

comment:12 Changed 13 years ago by s0undt3ch

  • Resolution set to fixed
  • Status changed from accepted to closed

Fixed in master.

Note: See TracTickets for help on using tickets.