[PATCHES] Build pytalloc for two Python versions at once, port to py3

Andrew Bartlett abartlet at samba.org
Thu Mar 12 21:08:25 MDT 2015

On Thu, 2015-03-12 at 12:08 +0100, Petr Viktorin wrote:

> I've started looking at tdb and ldb; you can see the WIP patches here:
> https://fedorapeople.org/cgit/pviktori/public_git/samba.git/commit/?h=py3compat-34ad28d&id=d479cbfe08b143f65c674a005f2acc9257a30a47
> https://fedorapeople.org/cgit/pviktori/public_git/samba.git/commit/?h=py3compat-34ad28d&id=34ad28d225771541e3a294bf3782be0839575148
> I'm not yet interested in a review of these patches, just note that they 
> don't really add a mess of #defines.

On these, this is what I don't like, and we need to be smarter about:

- self.assertEquals(["789"], list(rm["bla"]))
+ self.assertEquals([b"789"], list(rm["bla"]))

I don't want to see these b things everywhere, because we will be
chasing our tail for the whole duration of the port if one isn't added

LDB is LDAP, LDAP is UTF8.  Any 'unicode strings' should be
auto-converted to UTF8.  Likewise, str() of an LdbMessageElement should
convert them from UTF8 into a unicode string, if you must.

Andrew Bartlett

Andrew Bartlett
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba

More information about the samba-technical mailing list