From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id A7AA94C885; Thu, 14 Jan 2021 15:52:49 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A7AA94C885 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1610628769; bh=YdPjYVnFy+p9LPOWjdYh/YYoNsJ3t2Q1mVerdZfS7tQ=; h=To:References:Date:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=dwlvdcxq59GyECbgYq8Sv0uaWKAz/01PB0FCbNH3Nc1WcRcc9ONWm409jPMWsMft1 E2wamUqOXfMNzbFPV273/WUhAbNxUB1F3Dnrr0af19DJwc3rSZAIfOFWetxR1Ct0kb Lk6o0NO7eLROBEATirYoi9BgA7GOhn8vWwT1D0rY= Received: from smtp61.i.mail.ru (smtp61.i.mail.ru [217.69.128.41]) (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 BC0294C889 for ; Thu, 14 Jan 2021 15:52:47 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org BC0294C889 Received: by smtp61.i.mail.ru with esmtpa (envelope-from ) id 1l027L-0007Zi-2g; Thu, 14 Jan 2021 15:52:47 +0300 To: Alexander Turenko References: <28dc6d930bc93ece50cce5ba5f37b2eab4bdf50d.1610526975.git.estetus@gmail.com> <20210114123843.lszgppsskx734xjl@tkn_work_nb> Message-ID: Date: Thu, 14 Jan 2021 15:52:46 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210114123843.lszgppsskx734xjl@tkn_work_nb> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9D0E79FBC973162CD520EA9A9E182CF906B1BCD0E5756442500894C459B0CD1B92BCFBA9717C2D9E2486F8EC65A2849D47E70E0EA0DA2217B141B3585208100AE X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE772FD67E8B75B52AFEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006378556F4CD9D953FFE8638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FC480310FC876A81A658114D345C7D86C87A04C29C7706666B389733CBF5DBD5E913377AFFFEAFD269A417C69337E82CC2CC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92A417C69337E82CC2CC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB8D32BA5DBAC0009BE9E8FC8737B5C2249F0B3E03343D255BA76E601842F6C81A12EF20D2F80756B5F7E9C4E3C761E06A776E601842F6C81A127C277FBC8AE2E8B69CA9D5DD3A960893AA81AA40904B5D9DBF02ECDB25306B2B25CBF701D1BE8734AD6D5ED66289B5278DA827A17800CE788761406820A309867F23339F89546C5A8DF7F3B2552694A6FED454B719173D6725E5C173C3A84C33C2D715BE4CE1EFB35872C767BF85DA2F004C906525384306FED454B719173D6462275124DF8B9C938130EB80001CEACE5BFE6E7EFDEDCD789D4C264860C145E X-C1DE0DAB: 0D63561A33F958A5E1046819BB3FD0EC16F709C0BDCC790262BB0D91F3505702D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75448CF9D3A7B2C848410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34A9873270276D4334F5E9942FDDC69599D447070153CECAB5590659BC49A0B8553F83468D7EE12C4E1D7E09C32AA3244C3C7BC3D434A028BB6049F7FD09A969487C0C08F7987826B9927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj9kdO2HH36x6Re84hpoDtgQ== X-Mailru-Sender: C4F68CFF4024C8867DFDF7C7F25884585BAD865AE5CBD6B368D1BDDE777CA934FD5457F5548CF525282EC151BADDC1D3523A6D01B4765B2DFB59E2DDD9FE06B14FA522850F29BC30112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v1 2/4] test: fix xlog-py/big_lsn.test.py X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Cc: Sergey Bronnikov , tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Thanks for review! On 14.01.2021 15:38, Alexander Turenko wrote: >> @@ -17,7 +18,7 @@ new_lsn = 123456789123 >> wal_dir = os.path.join(server.vardir, server.name) >> old_wal = os.path.join(wal_dir, "%020d.xlog" % old_lsn) >> new_wal = os.path.join(wal_dir, "%020d.xlog" % new_lsn) >> -with open(old_wal, "r+") as f: >> +with codecs.open(old_wal, "r+", encoding = "ISO-8859-1") as f: > Nit: PEP-8 requires func(foo='bar') -- without surrounding whitespaces. Agree. Fixed in a branch. > > I would read the binary file using 'rb+' (to bytes) and convert strings, > which are known to be correct utf-8/ascii to Python strings (unicode) > manually, but your solution should work too (and requires less code). > > I was afraid that f.read() will see some bytes that're undefined in the > ISO-8859-1 encoding and it'll lead to an exception like it does for > UTF-8. But no, it just returns u'\x00' or kinda. > > Okay so.