From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id B81A245C304 for ; Wed, 16 Dec 2020 17:04:32 +0300 (MSK) References: <7ad65976-902f-8936-cb85-4232ff7ffce3@tarantool.org> From: Sergey Bronnikov Message-ID: <45fa75d8-129b-3170-eda2-5d170e225748@tarantool.org> Date: Wed, 16 Dec 2020 17:04:31 +0300 MIME-Version: 1.0 In-Reply-To: <7ad65976-902f-8936-cb85-4232ff7ffce3@tarantool.org> Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: 8bit Content-Language: en-US Subject: Re: [Tarantool-patches] [PATCH 3/4] test: make convert to hex compatible with Python 3.x List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Leonid Vasiliev , tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org, imun@tarantool.org Cc: alexander.turenko@tarantool.org 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 >> >> 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] >>