Problems with telnetlib
Jan-Fredrik Braseth
janfbr at sex.ifi.uio.no
Sat Feb 16 12:08:10 EST 2002
Sheila King <usenet at thinkspot.net> writes:
> On 16 Feb 2002 13:56:35 +0100, Jan-Fredrik Braseth
> <janfbr at sex.ifi.uio.no> wrote in comp.lang.python in article
> <xyuvgcxlh4s.fsf at sex.ifi.uio.no>:
>
> > but after some time I get this error message:
> >
> > Traceback (most recent call last):
> > File "./quizbot.py", line 366, in ?
> > foo = QuizBot(name,password,channel)
> > File "./quizbot.py", line 28, in __init__
> > line = self.tn.read_until("\n").split()
> > File "/usr/lib/python2.2/telnetlib.py", line 297, in read_until
> > self.process_rawq()
> > File "/usr/lib/python2.2/telnetlib.py", line 424, in process_rawq
> > self.msg('IAC %d not recognized' % ord(opt))
> > UnboundLocalError: local variable 'opt' referenced before assignment
> > >
> You have an error in your code. Show us the code. I'm guessing, that you
> have a variable 'opt' that under some circumstances is not defined
> before entering a particular loop or something.
If you look closely at the traceback you see that the error with opt is in the
telnetlib.py, that's a module for python. But it's unlikely that there is a bug
in python itself, isn't it?
BTW: it's python 2.2
--
Jan-Fredrik Braseth www.ifi.uio.no/~janfbr/
2B|!2B
More information about the Python-list
mailing list