ldap.ENCODING_ERROR when trying to use SimplePageResultsControl

Zhang Huangbin zhbmaillistonly at gmail.com
Mon Mar 16 13:23:36 CET 2009


Michael Ströder wrote:
> So this seems to boil down to that the following commands (lines
> wrapped) would fail at your site instead of returning the encoded
> control tuple:
>
>   
>>>> import ldap
>>>> from ldap.controls import SimplePagedResultsControl
>>>>
>>>>         
> SimplePagedResultsControl(ldap.LDAP_CONTROL_PAGE_OID,True,(10,'')).getEncodedTuple()
> ('1.2.840.113556.1.4.319', True, '0\x05\x02\x01\n\x04\x00')
>   


Thanks Michael. :)

You are right, here is the output:
----
# python
Python 2.4.3 (#1, Sep 17 2008, 16:07:08)
[GCC 4.1.2 20071124 (Red Hat 4.1.2-41)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> import ldap
 >>> ldap.__version__
'2.3.6'
 >>> from ldap.controls import SimplePagedResultsControl
 >>> 
SimplePagedResultsControl(ldap.LDAP_CONTROL_PAGE_OID,True,(10,'')).getEncodedTuple()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib64/python2.4/site-packages/ldap/controls.py", line 45, 
in getEncodedTuple
    return 
(self.controlType,self.criticality,self.encodeControlValue(self.controlValue))
  File "/usr/lib64/python2.4/site-packages/ldap/controls.py", line 78, 
in encodeControlValue
    return _ldap.encode_page_control(size,cookie)
ldap.ENCODING_ERROR
----

What's the problem? How can i solve it?

Thanks very much. :)

-- 
Best regards.

Zhang Huangbin

- Open Source Mail Server Solution for RHEL/CentOS 5.x:
  http://code.google.com/p/iredmail/




More information about the python-ldap mailing list