revision 109 crashes on start

Bug #216755 reported by Michael Otteneder on 2008-04-13
4
Affects Status Importance Assigned to Milestone
P1tr
High
Chris Ortner

Bug Description

Traceback (most recent call last):
  File "bot.py", line 59, in <module>
    main()
  File "bot.py", line 44, in main
    plugs = plugins.PluginLoader().load_plugins()
  File "/Users/mc/dev/p1tr/lib/plugins.py", line 34, in load_plugins
    mod_name.capitalize() + 'Plugin')())
  File "/Users/mc/dev/p1tr/plugins/insult.py", line 15, in __init__
    self.insults = self._load_resource('insults')
  File "/Users/mc/dev/p1tr/lib/plugin.py", line 86, in _load_resource
    except anydbm.error:
NameError: global name 'anydbm' is not defined[14:11:34] INFO: None

Chris Ortner (c-ortner) wrote :

This bug occurs on Debian 4.0 as well, but not on Ubuntu 8.04.

Changed in p1tr:
importance: Undecided → High
milestone: none → beta
status: New → Confirmed
Chris Ortner (c-ortner) wrote :

anydbm.error seems not to be known on different systems. On Debian 4.0 the exception raised in this case ist:
DBInvalidArgError: (22, 'Invalid argument -- ./data/insult_insults: unsupported hash version: 9')
data/insult_insults was created on Ubuntu 8.04 with the shelve module of Python 2.5.2, which seems to create a file with a bsddb format version, which does not work on Debian 4.0 and Mac OS 10.5.

Normally the resource files don't get shipped with P1tr, but for the insult plugin this is necessary.

Michael Otteneder (m-otteneder) wrote :

Looks like you have to import anydbm in order to use anydbm.error. But I don't think that it can be thrown by shelve.open()

Tinuviel:p1tr mc$ python
Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import shelve
>>> anydbm
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'anydbm' is not defined
>>> import anydbm
>>> anydbm.error
(<class 'anydbm.error'>, <class 'dbm.error'>, <type 'exceptions.IOError'>)

Chris Ortner (c-ortner) wrote :

Will be fixed by not delivering insults with P1tr. On first P1tr run, if no insults exist in data/insult_insults, P1tr imports a list of insults from http://server.austriangeekforce.net/insults.txt.

Changed in p1tr:
assignee: nobody → c-ortner
Chris Ortner (c-ortner) wrote :

Fixed in revision 110.

Changed in p1tr:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers