Unhelpful Error Messages No. 15: Find it yourself.

hg hansgeunsmeyer at earthlink.net
Fri Oct 11 21:21:00 EDT 2002


Dale Strickland-Clark <dale at riverhall.NOTHANKS.co.uk> wrote in message news:<eqsdqu0c4ufh4tgfa1669rhltbvjb3e5kb at 4ax.com>...
> I really could do with a line number in this error message. Or a bit
> more context. Unfortunately, rslhHTML is 1200+ lines and something
> like 40 classes.
> 
> This is from the command prompt. Harness.py has one line (the import)
> and a docstring. Oddly, if I import the module into PythonWin, I don't
> get an error.
> 
> Traceback (most recent call last):
>   File "harness.py", line 5, in ?
>     from rslhHTML import *
> TypeError: __init__() takes at least 2 arguments (1 given)
> 
> I've checked every use of __init__ and they all have more than 2
> arguments but what's more interesting is why it's picking this up at
> import time. It's not running any code. There's just a bunch of class
> definitions.

But the traceback has a very clear line nr: 5... You're punished for
using "import *".  Are you sure that rslhHTML isn't instantiating any
classes? Did you try import rslhHTML at the Python prompt?

Hans



More information about the Python-list mailing list