Blocklist Importer does not gracefully handle errors

Suggest, post, or discuss plugins for Deluge
Post Reply
FriedBunny
New User
New User
Posts: 7
Joined: Tue Nov 06, 2007 2:37 am

Blocklist Importer does not gracefully handle errors

Post by FriedBunny »

When loading Deluge with the Blocklist Importer plugin set to update and load automatically, it can crash if the blocklist input is not in a format it expects. Hitting the 'cancel' button has no effect, it attempts the load the file and Deluge exits with no notification of any sort. In this instance, the gzip file that it was attempting to load redirected to a HTML page.

Code: Select all

me@friedbunny:~$ deluge
no existing Deluge session
Starting new Deluge session...
deluge_core; using libtorrent 0.13.0.0. Compiled with NDEBUG.
Applying preferences
Pickling state...
Scanning plugin dir /usr/share/deluge/plugins
Initialising plugin MoveTorrent
Initialising plugin TorrentNotification
Initialising plugin TorrentSearch
Initialising plugin SimpleRSS
Initialising plugin TorrentFiles
Initialising plugin TorrentCreator
Initialising plugin DesiredRatio
Initialising plugin WebSeed
Initialising plugin Locations
Initialising plugin Scheduler
Initialising plugin SpeedLimiter
Initialising plugin NetworkHealth
Initialising plugin ExtraStats
Initialising plugin EventLogging
Initialising plugin WebUi
Initialising plugin BlocklistImport
Initialising plugin TorrentPeers
Initialising plugin NetworkGraph
Applying preferences
Starting DHT...
Showing window
Loading TorrentPeers plugin...
Loading ExtraStats plugin...
Loading TorrentFiles plugin...
Loading LogEvents plugin...
Loading TorrentNotification plugin...
Loading blocklist plugin ...
Fetching http://www.bluetack.co.uk/config/nipfilter.dat.gz
importing with gzmule
GZMuleReader loading /home/me/.config/deluge/blocklist.cache
MuleReader loading
TextBase loading
Starting import
Traceback (most recent call last):
  File "/usr/bin/deluge", line 121, in <module>
    start_deluge()
  File "/usr/bin/deluge", line 110, in start_deluge
    interface.start(get_cmd_line_torrents())
  File "/var/lib/python-support/python2.5/deluge/interface.py", line 949, in start
    self.plugins.enable_plugin("Blocklist Importer")
  File "/var/lib/python-support/python2.5/deluge/plugins.py", line 76, in enable_plugin
    self.enabled_plugins[name] = plugin.enable(self.core, self.interface)
  File "/usr/share/deluge/plugins/BlocklistImport/__init__.py", line 29, in enable
    return BlocklistImport(path, core, interface)
  File "/usr/share/deluge/plugins/BlocklistImport/__init__.py", line 66, in __init__
    self.loadlist(fetch=self.config.get('load_on_start'))
  File "/usr/share/deluge/plugins/BlocklistImport/__init__.py", line 110, in loadlist
    ips = reader.next()
  File "/usr/share/deluge/plugins/BlocklistImport/text.py", line 31, in next
    txt = self.fd.readline()
  File "/usr/lib/python2.5/gzip.py", line 399, in readline
    c = self.read(readsize)
  File "/usr/lib/python2.5/gzip.py", line 227, in read
    self._read(readsize)
  File "/usr/lib/python2.5/gzip.py", line 263, in _read
    self._read_gzip_header()
  File "/usr/lib/python2.5/gzip.py", line 164, in _read_gzip_header
    raise IOError, 'Not a gzipped file'
IOError: Not a gzipped file
markybob
Compulsive Poster
Compulsive Poster
Posts: 1230
Joined: Thu May 24, 2007 11:27 pm
Location: Chicago, IL, USA
Contact:

Re: Blocklist Importer does not gracefully handle errors

Post by markybob »

FriedBunny wrote:When loading Deluge with the Blocklist Importer plugin set to update and load automatically, it can crash if the blocklist input is not in a format it expects. Hitting the 'cancel' button has no effect, it attempts the load the file and Deluge exits with no notification of any sort. In this instance, the gzip file that it was attempting to load redirected to a HTML page.

Code: Select all

me@friedbunny:~$ deluge
no existing Deluge session
Starting new Deluge session...
deluge_core; using libtorrent 0.13.0.0. Compiled with NDEBUG.
Applying preferences
Pickling state...
Scanning plugin dir /usr/share/deluge/plugins
Initialising plugin MoveTorrent
Initialising plugin TorrentNotification
Initialising plugin TorrentSearch
Initialising plugin SimpleRSS
Initialising plugin TorrentFiles
Initialising plugin TorrentCreator
Initialising plugin DesiredRatio
Initialising plugin WebSeed
Initialising plugin Locations
Initialising plugin Scheduler
Initialising plugin SpeedLimiter
Initialising plugin NetworkHealth
Initialising plugin ExtraStats
Initialising plugin EventLogging
Initialising plugin WebUi
Initialising plugin BlocklistImport
Initialising plugin TorrentPeers
Initialising plugin NetworkGraph
Applying preferences
Starting DHT...
Showing window
Loading TorrentPeers plugin...
Loading ExtraStats plugin...
Loading TorrentFiles plugin...
Loading LogEvents plugin...
Loading TorrentNotification plugin...
Loading blocklist plugin ...
Fetching http://www.bluetack.co.uk/config/nipfilter.dat.gz
importing with gzmule
GZMuleReader loading /home/me/.config/deluge/blocklist.cache
MuleReader loading
TextBase loading
Starting import
Traceback (most recent call last):
  File "/usr/bin/deluge", line 121, in <module>
    start_deluge()
  File "/usr/bin/deluge", line 110, in start_deluge
    interface.start(get_cmd_line_torrents())
  File "/var/lib/python-support/python2.5/deluge/interface.py", line 949, in start
    self.plugins.enable_plugin("Blocklist Importer")
  File "/var/lib/python-support/python2.5/deluge/plugins.py", line 76, in enable_plugin
    self.enabled_plugins[name] = plugin.enable(self.core, self.interface)
  File "/usr/share/deluge/plugins/BlocklistImport/__init__.py", line 29, in enable
    return BlocklistImport(path, core, interface)
  File "/usr/share/deluge/plugins/BlocklistImport/__init__.py", line 66, in __init__
    self.loadlist(fetch=self.config.get('load_on_start'))
  File "/usr/share/deluge/plugins/BlocklistImport/__init__.py", line 110, in loadlist
    ips = reader.next()
  File "/usr/share/deluge/plugins/BlocklistImport/text.py", line 31, in next
    txt = self.fd.readline()
  File "/usr/lib/python2.5/gzip.py", line 399, in readline
    c = self.read(readsize)
  File "/usr/lib/python2.5/gzip.py", line 227, in read
    self._read(readsize)
  File "/usr/lib/python2.5/gzip.py", line 263, in _read
    self._read_gzip_header()
  File "/usr/lib/python2.5/gzip.py", line 164, in _read_gzip_header
    raise IOError, 'Not a gzipped file'
IOError: Not a gzipped file
yep...i actually fixed this in svn yesterday. it'll be in the next release
FriedBunny
New User
New User
Posts: 7
Joined: Tue Nov 06, 2007 2:37 am

Re: Blocklist Importer does not gracefully handle errors

Post by FriedBunny »

Great! Thanks for so actively developing Deluge, it's getting better by the day.
Post Reply