[python-ldap] Patch: ldap.syncrepl UUID constructors use bytes (Python 3 compatbility)
Michael Ströder
michael at stroeder.com
Mon Jun 5 05:24:55 EDT 2017
Karl Kornel wrote:
> The problem is this: In Python 3, the UUID class constructor’s “bytes” input requires
> that you provide a bytes object.
> [..]
> This patch also works on test code I have in development
> (https://github.com/akkornel/syncrepl), running on Python 2.7 with python-ldap 2.4.38.
> But, I understand that you might not want to accept this until the t_syncrepl.py is
> more complete.
Thanks for your submission.
AFAIK the built-in function bytes() was introduced in Python 2.6. So unfortunately this
raises a question about back-ward compability to older Python versions.
Which versions of Python 2.x still have to be supported by today's python-ldap?
Yes, I know. We could do something like:
try:
bytes
except NameError:
bytes = str
But I'm not sure whether it makes sense to add compability kludges into python-ldap.
Ciao, Michael.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3829 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20170605/1e77929b/attachment-0001.bin>
More information about the python-ldap
mailing list