-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stephen Warren wrote:
> Jason R. Mastaler wrote:
>>> It doesn't seem to work for me. What am I doing wrong? I've tried
>>> ...
>>> error: uncaptured python exception, closing channel...
> 
> I've built/installed Python 2.5 on my box and have this same exception
> (using TBird 1.5.0.9 Linux as a client). I'll work on fixing it...

OK. I have found out what is going on, but am not yet sure how to fix it...

The tlslite code uses a lot of generators (functions with Python yield
statement). Pre Python 2.5, it used to be that the yield statement
simply sent data back to the caller, but never returned any new
information, or threw exceptions. In Python 2.5, yield can now return
data, or even throw exceptions.

Now for some reason, the caller of readAsync (TLSRecordLayer.py) is
throwing an exception back into readAsync's yield statement, which then
catches the exception, thinking some of its own code threw the
exception, and hence handles the error by shutting down the connection etc.

I assume this is related to Python 2.5's new send() API, which when
called on a generator pushes a value back into the generator (return
value from yield) or, I think, can throw an exception into it (I know
exceptions can be thrown into yield, just not sure the send API is what
does it). Certainly, some tlslite code uses send() calls (because the
socket API which it emulates has a send() call).

The Python debugger kinda sucks at debugging this stuff!

Anyway, if I change from this:

yield(whatever)

to:

try:
  yield(whatever)
except:
  pass

then SSL mode works with Python 2.5 (haven't tried TLS yet).

But, I don't think that's the fix; I want to stop the exception being
thrown into the yield in the first place.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFF5Q9Jhk3bo0lNTrURAnYBAKCy8O7dBt1arODBysFBNbkv/jn+ygCfUAn4
Ah2SVo2QE1LKmZX6So1AB0Q=
=9fOX
-----END PGP SIGNATURE-----
_________________________________________________
tmda-workers mailing list ([email protected])
http://tmda.net/lists/listinfo/tmda-workers

Reply via email to