[Tarantool-patches] [PATCH 3/4] test: make convert to hex compatible with Python 3.x

Sergey Bronnikov sergeyb at tarantool.org
Wed Dec 16 17:04:31 MSK 2020


Hello,


On 15.12.2020 14:55, Leonid Vasiliev wrote:
> Hi! Thank you for the patch.
>
> On 11.12.2020 11:42, Sergey Bronnikov via Tarantool-patches wrote:
>> From: Sergey Bronnikov <sergeyb at tarantool.org>
>>
>> Part of #5538
>> ---
>>   test/box-py/iproto.test.py | 6 +++++-
>>   1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/test/box-py/iproto.test.py b/test/box-py/iproto.test.py
>> index 25ead43c4..72400923c 100644
>> --- a/test/box-py/iproto.test.py
>> +++ b/test/box-py/iproto.test.pyHi
>> @@ -191,7 +191,11 @@ for test in TESTS:
>>       print("STR", size)
>>       print("--")
>>       for fmt in it:
>> -        print("0x" + fmt.encode("hex"), "=>", end=" ")
>> +        try:
>> +            # Python 3
>> +            print("0x" + "hex".encode("utf-8").hex(), "=>", end=" ")
>
> Maybe fmt.encode("utf-8").hex()?

I would be glad to use it in Python 3, but fmt module was removed there.


> Please, add a comment that describing the difference between python2 and
> python3 in this print.
>
Added comment to a commit message and force-pushed.
>> +        except AttributeError:
>> +            print("0x" + fmt.encode("hex"), "=>", end=" ")
>>           field = "*" * size
>>           c._send_request(RawInsert(c, space_id, "\x91" + fmt + field))
>>           tuple = space.select(field)[0]
>>


More information about the Tarantool-patches mailing list