[python-ldap] Auto encoding of binary fields

Ritesh Nadhani riteshn at gmail.com
Tue May 16 23:34:20 EDT 2017


Hello

On Sat, May 13, 2017 at 1:23 AM, Michael Ströder <michael at stroeder.com> wrote:
> Ritesh Nadhani wrote:
>> Using ldapsearch, it seems it autoencodes non printable attribute
>> value into something that is more printable on console.
>>
>> Is there any flag with python-ldap package that can do the same?
>
> The ldapsearch command-line outputs LDIF (see RFC 2849):
> https://tools.ietf.org/html/rfc2849
>
> The module ldif can be used to do the same:
> https://www.python-ldap.org/doc/html/ldif.html

Thanks. Learnt something new.

One more observation that I cannot seem to find information for, is
why the python package returns every attribute value as a list. Even
for attribute like sAMAccountName (which seems can only hold on single
string value) is returned as:

['someName']

For display purposes in my app, I would like to show those values as
single element but attributes which allow multiple values as list. Is
there some specification/list of fields that can be multivalue?

Sorry, if its something that I overlooked or is just a simple question.

>
> Ciao, Michael.
>



-- 
Ritesh


More information about the python-ldap mailing list