[Freeipa-devel] [PATCHES] More Python 3 porting

Petr Viktorin pviktori at redhat.com
Tue Oct 6 10:04:16 UTC 2015


On 10/05/2015 07:56 AM, Jan Cholasta wrote:
> On 2.10.2015 13:09, Petr Viktorin wrote:
>> On 10/01/2015 03:15 PM, Jan Cholasta wrote:
>>> Hi,
>>>
>>> On 1.10.2015 13:01, Martin Basti wrote:
>>>>
>>>>
>>>> On 09/30/2015 10:25 AM, Petr Viktorin wrote:
>>>>> On 09/23/2015 04:46 PM, Petr Viktorin wrote:
>>>>>> On 09/22/2015 02:59 PM, David Kupka wrote:
>>>>>>> On 18/09/15 17:00, Petr Viktorin wrote:
>>>>>>>> Hello,
>>>>>>>> Here are more patches that bring IPA closer to Python 3
>>>>>>>> compatibility.
>> [...]
>>>>>
>>>> LGTM
>>>>
>>>> I ran xmlrpc tests, DNSSEC ci tests, backup and restore CI test and
>>>> everything works
>>>
>>> Patches 713-719: ACK
>>>
>>>
>>> Patch 720:
>>>
>>> You missed:
>>>
>>> ipa-client/ipa-install/ipa-client-install:32:    from ConfigParser
>>> import RawConfigParser
>>
>>
>> Thanks, fixed.
>>
>>> Patches 721-722: ACK
>>>
>>>
>>> Patch 723:
>>>
>>> Why the "NoneType = type(None)" in parameters.py? It is used only at:
>>>
>>> ipalib/parameters.py:388:    type = NoneType  # Ouch, this wont be very
>>> useful in the real world!
>>
>> I believe this is less confusing than `type = type(None)`, but I can
>> change that if needed.
> 
> I don't care which one is used TBH, just that it is done consistently
> accross the whole patch, and this seemed like the simpler thing to do.

OK, changed.

>>> Patch 724:
>>>
>>> The SSHPublicKey class was written with the assumption that "str" means
>>> binary data, so unless I'm missing something, you only need to replace
>>> "str" with "bytes".
>>
>> It specifically did take non-binary data as str:
>>
>> -        if isinstance(key, str) and key[:3] != '\0\0\0':
>> -            key = key.decode(encoding)
> 
> I don't follow, this is quite obviously binary data. It reads: "If key
> is binary and does not start with 3 null bytes, decode it to text using
> the specified encoding."

Right, it's text (non-binary) data encoded in str (bytes), so it needs
to be encoded.

>> I've removed this for Python 3, where text data shouldn't be in bytes.
>>
>> Since this means the '\0\0\0' check is skipped in __init__ under Python
>> 3, I've added it also to _parse_raw.
> 
> When the SSH integration feature was first introduced, SSH public keys
> were stored in the raw binary form in LDAP, i.e. not text data. We still
> need to support that, so support for binary data and the 3 null check
> must remain in SSHPublicKey.

Changed, updated patches attached.



-- 
Petr Viktorin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0713.4-ipap11helper-Port-to-Python-3.patch
Type: text/x-patch
Size: 16522 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20151006/d35d5b10/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0714.4-rpc-Don-t-use-undocumented-urllib-functions.patch
Type: text/x-patch
Size: 1284 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20151006/d35d5b10/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0715.4-ipapython.dn-Use-rich-comparisons.patch
Type: text/x-patch
Size: 10236 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20151006/d35d5b10/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0716.4-test_dn-Split-bytes-and-unicode.patch
Type: text/x-patch
Size: 8225 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20151006/d35d5b10/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0717.4-Use-sys.maxsize-instead-of-sys.maxint.patch
Type: text/x-patch
Size: 3675 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20151006/d35d5b10/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0718.4-Use-six.moves.urllib-instead-of-urllib-urllib2-urlpa.patch
Type: text/x-patch
Size: 26145 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20151006/d35d5b10/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0719.4-Use-six.moves.xmlrpc.client-instead-of-xmlrpclib.patch
Type: text/x-patch
Size: 13249 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20151006/d35d5b10/attachment-0006.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0720.4-Use-six.moves.configparser-instead-of-ConfigParser.patch
Type: text/x-patch
Size: 12096 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20151006/d35d5b10/attachment-0007.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0721.4-Use-six.moves.http_client-instead-of-httplib.patch
Type: text/x-patch
Size: 3748 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20151006/d35d5b10/attachment-0008.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0722.4-Use-six.Stringio-instead-of-StringIO.StringIO.patch
Type: text/x-patch
Size: 3978 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20151006/d35d5b10/attachment-0009.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0723.4-Remove-uses-of-the-types-module.patch
Type: text/x-patch
Size: 12964 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20151006/d35d5b10/attachment-0010.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0724.4-ipapython.ssh-Port-to-Python-3.patch
Type: text/x-patch
Size: 4629 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20151006/d35d5b10/attachment-0011.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0725.4-Appease-pylint.patch
Type: text/x-patch
Size: 1277 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20151006/d35d5b10/attachment-0012.bin>


More information about the Freeipa-devel mailing list