Odd error with sasl_interactive_bind_s

Deepak Giridharagopal deepak at arlut.utexas.edu
Thu Mar 3 00:07:15 CET 2005


On Wed, 2005-03-02 at 14:11 -0600, Deepak Giridharagopal wrote:
> The 'sasl_flags' variable is declared as an unsigned int, but it looks
> like we're trying to convert it using the "I" flag, which is meant to
> convert longs. Replacing that "I" with "i" tells Python to convert that
> argument to an int (rather than a long), and it seems to do the trick.

Upon further research, it looks like in Python 2.3 (and later) the "I"
flag will *either* convert the argument to a long *or* an unsigned int.
In previous versions of Python, "I" will attempt to always convert to a
long (resulting in the TypeError).

I guess this definitively solves the mystery as to why the bug doesn't
occur in 2.3 and above...

So I've (slightly) re-worked the patch to examine what version of Python
is being used and react accordingly.

Cheers!
deepak

--
Deepak Giridharagopal
Applied Research Laboratories
University of Texas at Austin


-------------- next part --------------
A non-text attachment was scrubbed...
Name: ldap_sasl_typerror_fix.patch
Type: text/x-patch
Size: 1256 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20050302/ef5235d1/attachment.bin>


More information about the python-ldap mailing list