[python-ldap] Ldif parser bug?

Michael Ströder michael at stroeder.com
Wed Sep 30 19:18:20 CEST 2015


Michael Ströder wrote:
> Tobias Diaz Diaz-Chiron wrote:
>> I'm working with the ldif parser and I've found this behaviour:
>>
>> If the DN is like:
>>
>> dn: dc=operator,dc=com
>>
>> it works fine, but if we remove the space after the quotes:
>>
>> dn:dc=operator,dc=com
>>
>> Parsing results in a ugly "referenced before assignment" error. I've
>> checked the RFC about LDIF format and it doesn't mention that the space is
>> mandatory, so I think the parser should allow this. The solution (I think)
>> it's easy: just add an "else" clause at the "_next_key_and_value(self)"
>> method just to allow this.
>>
>> What do you think?
> 
> It seems you're right.

This is fixed now in CVS HEAD. Please test.

Ciao, Michael.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4245 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20150930/a0b1262e/attachment-0001.bin>


More information about the python-ldap mailing list