Ticket #1944: errno.patch

File errno.patch, 2.0 KB (added by cgreco, 13 years ago)
  • deluge/core/torrentmanager.py

    diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py
    index 3f95bb0..c7e055e 100644
    a b def remove_empty_folders(self, torrent_id, folder):  
    847847                            os.removedirs(os.path.join(root, name))
    848848                            log.debug("Removed Empty Folder %s", os.path.join(root, name))
    849849                        except OSError as (errno, strerror):
    850                             if errno == 39:
     850                            if errno == errno.ENOTEMPTY:
    851851                                # Error raised if folder is not empty
    852852                                log.debug("%s", strerror)
    853853
  • deluge/plugins/AutoAdd/deluge/plugins/autoadd/core.py

    diff --git a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/core.py b/deluge/plugins/AutoAdd/deluge/plugins/autoadd/core.py
    index a8405b4..0235e2e 100644
    a b def update_watchdir(self, watchdir_id):  
    268268                    try:
    269269                        os.rename(filepath, copy_torrent_file)
    270270                    except OSError, why:
    271                         if why.errno == 18:
     271                        if why.errno == errno.EXDEV:
    272272                            # This can happen for different mount points
    273273                            from shutil import copyfile
    274274                            try:
  • deluge/ui/gtkui/connectionmanager.py

    diff --git a/deluge/ui/gtkui/connectionmanager.py b/deluge/ui/gtkui/connectionmanager.py
    index a883976..91862dd 100644
    a b def start_daemon(self, port, config):  
    475475        try:
    476476            return client.start_daemon(port, config)
    477477        except OSError, e:
    478             if e.errno == 2:
     478            if e.errno == errno.ENOENT:
    479479                dialogs.ErrorDialog(
    480480                    _("Unable to start daemon!"),
    481481                    _("Deluge cannot find the 'deluged' executable, it is "