Opened 7 years ago

Closed 7 years ago

#2953 closed bug (Fixed)

code typo (ex -> e) in move_storage() preventing 'move storage' error from being proper logged

Reported by: neon666 Owned by: Cas
Priority: minor Milestone: 1.3.14
Component: Core Version: 1.3.13
Keywords: Cc:

Description

Nothing happens when attempting to move storage under certain conditions. The error from deluged.log is below. I believe it is a simple typo - the last argument to log_error should be e (the error reported), not ex (which doesn't exist). The code snippet from torrent.py is also below.

The deluged.log generates this error:

Code highlighting:

  [ERROR   ] 10:50:08 rpcserver:304 Exception calling RPC request: global name 'ex' is not defined
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/deluge/core/rpcserver.py", line 299, in dispatch
    ret = self.factory.methods[method](*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/deluge/core/core.py", line 411, in move_storage
    if not self.torrentmanager[torrent_id].move_storage(dest):
  File "/usr/lib/python2.7/site-packages/deluge/core/torrent.py", line 913, in move_storage
    self.torrent_id, dest, ex)
NameError: global name 'ex' is not defined

Lines 906 - 914 in deluge/core/torrent.py, the 'ex' in the line next to last should be 'e':

Code highlighting:

    if not os.path.exists(dest):
      try:
          # Try to make the destination path if it doesn't exist
          os.makedirs(dest)
      except OSError, e:
          log.error("Could not move storage for torrent %s since %s does "
                    "not exist and could not create the directory: %s",
                    self.torrent_id, dest, ex)
          return False

Change History (4)

comment:1 Changed 7 years ago by fermulator

  • Priority changed from trivial to minor
  • Status changed from new to pending
  • Version changed from other (please specify) to 1.3.13

I ran into this myself today, found this bug report, can confirm the defect.

After correcting the typo and restarting deluged, the appropriate logs are actually error'd into the deluge log file (such as)

[ERROR   ] 22:39:23 torrent:913 Could not move storage for torrent 0249250b53385b1429323d93cb7467b45d097212 since "/mnt/foo/Setups/Operating Systems/Linux/FOO/" does not exist and could not create the directory: [Errno 13] Permission denied: '"'
[WARNING ] 22:39:23 core:412 Error moving torrent 0249250b53385b1429323d93cb7467b45d097212 to "/mnt/foo/Setups/Operating Systems/Linux/FOO/"

Version info:

$ dpkg --list | grep deluge
ii  deluge                              1.3.13-0~trusty~ppa1                 all          bittorrent client written in Python/PyGTK
ii  deluge-common                       1.3.13-0~trusty~ppa1                 all          bittorrent client written in Python/PyGTK (common files)
ii  deluge-gtk                          1.3.13-0~trusty~ppa1                 all          bittorrent client written in Python/PyGTK (GTK+ ui)
ii  deluge-web                          1.3.13-0~trusty~ppa1                 all          bittorrent client written in Python/PyGTK (web ui)
ii  deluged                             1.3.13-0~trusty~ppa1                 all          bittorrent client written in Python/PyGTK (daemon)

Would be happy to fix into git (just not sure which branch to put it on)

Last edited 7 years ago by fermulator (previous) (diff)

comment:2 Changed 7 years ago by fermulator

  • Summary changed from code typo preventing 'move storage' to code typo (ex -> e) in move_storage() preventing 'move storage' error from being proper logged

comment:3 Changed 7 years ago by Cas

  • Milestone changed from needs verified to 1.3.14
  • Owner set to Cas
  • Status changed from pending to accepted

comment:4 Changed 7 years ago by Cas

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

Fixed: [3c1995476d]

Note: See TracTickets for help on using tickets.