Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #46263

Re: Ldap module and base64 oncoding

Path csiph.com!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail
From Michael Ströder <michael@stroeder.com>
Newsgroups comp.lang.python
Subject Re: Ldap module and base64 oncoding
Date Tue, 28 May 2013 09:45:32 +0200
Organization A noiseless patient Spider
Lines 28
Message-ID <ko1n2s$a5c$1@dont-email.me> (permalink)
References <knt87q$cm3$1@dont-email.me> <kntomp$jsn$1@dont-email.me> <knv3bs$b47$1@dont-email.me> <mailman.2269.1369699988.3114.python-list@python.org>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 7bit
Injection-Date Tue, 28 May 2013 07:41:16 +0000 (UTC)
Injection-Info mx05.eternal-september.org; posting-host="aa8416e549b3f8411710267ad23b175c"; logging-data="10412"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/oEpe80Ab70jwtt2XKOcXvJyDmH5QM0BM="
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:20.0) Gecko/20100101 Firefox/20.0 SeaMonkey/2.17.1
In-Reply-To <mailman.2269.1369699988.3114.python-list@python.org>
Cancel-Lock sha1:98yrRae/asLrHwf57XZPfvAWoyw=
Xref csiph.com comp.lang.python:46263

Show key headers only | View raw


Joseph L. Casale wrote:
> I had some time today, so I attempted to open the ldif files in binary mode to simply
> work with the raw byte strings but the moment the first entry was parsed, parse()
> stumbled on a character in the first entries dict and passed a dn of None for the last half?

Without seeing the LDIF data and your code I can't tell what's going on.

> If the option to avoid worrying about decoding and encoding could work, I would be
> happy to process the whole lot in byte strings. Any idea what may cause this?

I would not claim that module 'ldif' has really awesome docs.
But did you follow the example with LDIFParser in the docs?

http://www.python-ldap.org/doc/html/ldif.html#example

It illustrates that for LDIF stream processing one basically derives a class
from ldif.LDIFParser overriding method handle(). The most basic test would be
something like this:

[..]
   def handle(self,dn,entry):
     print '***dn',repr(dn)
     pprint.pprint(entry)

And then carefully look at the output.

Ciao, Michael.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Ldap module and base64 oncoding "Joseph L. Casale" <jcasale@activenetwerx.com> - 2013-05-24 21:00 +0000
  Re: Ldap module and base64 oncoding Michael Ströder <michael@stroeder.com> - 2013-05-26 17:07 +0200
    RE: Ldap module and base64 oncoding "Joseph L. Casale" <jcasale@activenetwerx.com> - 2013-05-26 16:19 +0000
      Re: Ldap module and base64 oncoding Michael Ströder <michael@stroeder.com> - 2013-05-26 21:48 +0200
        RE: Ldap module and base64 oncoding "Joseph L. Casale" <jcasale@activenetwerx.com> - 2013-05-27 05:15 +0000
          Re: Ldap module and base64 oncoding Michael Ströder <michael@stroeder.com> - 2013-05-27 09:56 +0200
            RE: Ldap module and base64 oncoding "Joseph L. Casale" <jcasale@activenetwerx.com> - 2013-05-28 00:12 +0000
              Re: Ldap module and base64 oncoding Michael Ströder <michael@stroeder.com> - 2013-05-28 09:45 +0200
        Re: Ldap module and base64 oncoding dieter <dieter@handshake.de> - 2013-05-27 08:04 +0200

csiph-web