[python-ldap] Refactoring LDIFParser

Michael Ströder michael at stroeder.com
Sat Jun 20 16:20:43 CEST 2015


I'm currently rewriting parts of class ldif.LDIFParser and committed the first
working version to CVS HEAD. The goal is to keep it backwards-compatible while
adding basic support for change records (currently only changetype: modify).

See the current diff:


See current excerpt of CHANGES below.
I plan to release this pretty soon durig the next two weeks.

So I'd like to encourage everybody to thoroughly test this new module version,
at first focusing on the old parsing functionality. Ideally if you have good
test coverage in your own code please run your tests with it.

The new code looks a bit nicer but it slightly slower. If anyone here has some
spare cycle I'd appreciate concrete suggestions for performance improvement.

Please report any issue you see on the mailing list here.

Ciao, Michael.


* Abandoned old syntax when raising ValueError in modules ldif and
  ldapurl, more information in some exceptions.
* Refactored parts in ldif.LDIFParser:
  - New class attributes line_counter and byte_counter contain
    amount of LDIF data read so far
  - Renamed some internally used methods
  - Added support for parsing change records currently limited to
    changetype: modify
  - New separate methods parse_entry_records() (also called by parse())
    and parse_change_records()
  - Stricter order checking of dn:, changetype:, etc.
  - Removed non-existent 'AttrTypeandValueLDIF' from ldif.__all__

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

More information about the python-ldap mailing list