Menu

#62 Pypy support

None
closed-wont-fix
pypy (1)
5
2014-11-23
2014-05-27
Xaroth
No

Hi,

While python-ldap compiles and installs just fine on pypy, simple search_s calls fail to return information.
For now this only seems to happen when the attrlist option is set, at which point no attrs are returned.

Example:

python 2.7 (working)

Python 2.7.6 (default, Feb 26 2014, 13:22:43)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import ldap
conn = ldap.initialize('ldapi://')
conn.search_s("dc=xaroth,dc=nl", ldap.SCOPE_SUBTREE, "uid=testuser1")
[('uid=testuser1,ou=people,dc=xaroth,dc=nl', {'uid': ['testuser1'], 'objectClass': ['inetOrgPerson', 'organizationalPerson', 'person', 'djangoUser', 'posixAccount', 'sambaSamAccount', 'shadowAccount', 'top'], 'uidNumber': ['2000'], 'sambaAcctFlags': ['[U]'], 'djangoStaff': ['TRUE'], 'sambaPwdCanChange': ['0'], 'cn': ['Test User'], 'sambaPwdMustChange': ['9999999999999'], 'mail': ['test@test.test'], 'loginShell': ['/bin/bash'], 'djangoLastLogon': ['1400678905'], 'gidNumber': ['65534'], 'djangoSuper': ['TRUE'], 'sambaPwdLastSet': ['1'], 'sambaNTPassword': ['0CB6948805F797BF2A82807973B89537'], 'djangoCreated': ['1394110800'], 'givenName': ['Test'], 'displayName': ['Test User'], 'sambaSID': ['S-1-5-21-3142529177-3954413866-2593274125-4000'], 'sn': ['User'], 'homeDirectory': ['/home/testuser1'], 'djangoActive': ['TRUE']})]
conn.search_s("dc=xaroth,dc=nl", ldap.SCOPE_SUBTREE, "uid=testuser1", ["uid"])
[('uid=testuser1,ou=people,dc=xaroth,dc=nl', {'uid': ['testuser1']})]

pypy 2.2.1 (not working)

Python 2.7.3 (2.2.1+dfsg-1, Nov 28 2013, 05:13:10)
[PyPy 2.2.1 with GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``the future has just begun''

import ldap
conn = ldap.initialize('ldapi://')
conn.search_s("dc=xaroth,dc=nl", ldap.SCOPE_SUBTREE, "uid=testuser1")
[('uid=testuser1,ou=people,dc=xaroth,dc=nl', {'uid': ['testuser1'], 'objectClass': ['inetOrgPerson', 'organizationalPerson', 'person', 'djangoUser', 'posixAccount', 'sambaSamAccount', 'shadowAccount', 'top'], 'uidNumber': ['2000'], 'sambaAcctFlags': ['[U]'], 'djangoStaff': ['TRUE'], 'sambaPwdCanChange': ['0'], 'cn': ['Test User'], 'sambaPwdMustChange': ['9999999999999'], 'mail': ['test@test.test'], 'loginShell': ['/bin/bash'], 'djangoLastLogon': ['1400678905'], 'gidNumber': ['65534'], 'djangoSuper': ['TRUE'], 'sambaPwdLastSet': ['1'], 'sambaNTPassword': ['0CB6948805F797BF2A82807973B89537'], 'djangoCreated': ['1394110800'], 'givenName': ['Test'], 'displayName': ['Test User'], 'sambaSID': ['S-1-5-21-3142529177-3954413866-2593274125-4000'], 'sn': ['User'], 'homeDirectory': ['/home/testuser1'], 'djangoActive': ['TRUE']})]
conn.search_s("dc=xaroth,dc=nl", ldap.SCOPE_SUBTREE, "uid=testuser1", ["uid"])
[('uid=testuser1,ou=people,dc=xaroth,dc=nl', {})]

Note how normal search_s calls (without an attrlist set) returns the same information as python 2.7 would, however, with the attrlist set, no attrs are returned.

Versions used:

pypy:
python -V && pip freeze | grep python-ldap
Python 2.7.3 (2.2.1+dfsg-1, Nov 28 2013, 05:13:10)
[PyPy 2.2.1 with GCC 4.8.2]
python-ldap==2.4.15

python2.7:
python -V && pip freeze | grep python-ldap
Python 2.7.6
python-ldap==2.4.15

Discussion

  • Michael Ströder

    It's unclear what to do.

    pypy-2.4 does not even import ldap anymore.

     
  • Michael Ströder

    • status: open --> closed-wont-fix
    • assigned_to: Michael Ströder
    • Group: -->
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.