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 D007D4AD80; Thu, 14 Jan 2021 15:38:21 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D007D4AD80 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1610627901; bh=onfAfBjbs91upCUhpHmE9lQqLKa6TFtSS1zJ5e7F6RU=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=zRzRoQkWGKmjO0lGYd03znArZruyI7HUj6aISIN+U/eLOarpHldiBbbunTR1ciaFh ZRr+7D/oiAER0q2tEQHtegLVrJ4ESsfiq7JY5lNfGz79FeggmkU9bNxfzeA8TQ/1yL tmM+yZHyR5fmdsSYyaVqb1AIzVD0a6hRc1loMqgY= Received: from smtp48.i.mail.ru (smtp48.i.mail.ru [94.100.177.108]) (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 BB9FD4C889 for ; Thu, 14 Jan 2021 15:38:20 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org BB9FD4C889 Received: by smtp48.i.mail.ru with esmtpa (envelope-from ) id 1l01tL-0006cf-U1; Thu, 14 Jan 2021 15:38:20 +0300 Date: Thu, 14 Jan 2021 15:38:43 +0300 To: sergeyb@tarantool.org Message-ID: <20210114123843.lszgppsskx734xjl@tkn_work_nb> References: <28dc6d930bc93ece50cce5ba5f37b2eab4bdf50d.1610526975.git.estetus@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <28dc6d930bc93ece50cce5ba5f37b2eab4bdf50d.1610526975.git.estetus@gmail.com> X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9D0E79FBC973162CD9807AE62CAC2B33C765C844EAC374FFF00894C459B0CD1B9C88F17B4414B44C86B2F5038ED37030B411A48013A4423E3F600E77B63AAB791 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7D9B0C78E17BAE9D7EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006377A079619B0C2EE308638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FC5F1CB819CBF01AE65BDA76AC93BC19C73C4581DA22DEE811389733CBF5DBD5E913377AFFFEAFD269A417C69337E82CC2CC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92176DF2183F8FC7C07E7E81EEA8A9722B8941B15DA834481F9449624AB7ADAF37BA3038C0950A5D3613377AFFFEAFD2691661749BA6B977359A8507EF4041EDD57B076A6E789B0E97A8DF7F3B2552694A1E7802607F20496D49FD398EE364050FC24E1E72F37C03A08F49F126DDB898E8B3661434B16C20AC78D18283394535A975ECD9A6C639B01BC09775C1D3CA48CF0B8B320EE581A76035872C767BF85DA22EF20D2F80756B5F40A5AABA2AD3711975ECD9A6C639B01B78DA827A17800CE7AD892BA7D319F029731C566533BA786A40A5AABA2AD371193C9F3DD0FB1AF5EB51CDAA41CE8B6EBE3C9F3DD0FB1AF5EB4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A5DDB46961FDF6687C6D3823C42D7A87F5FFF2713DDA0AE6CED59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75448CF9D3A7B2C848410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3472E5ECC12A9739C1261FFA779FCB70D5B22D23EE7CBCFAA2672F32450CB0451424ED9797FDB2A0EF1D7E09C32AA3244CE0E039404E596C3B6DE230670B9D603833C9DC155518937F927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj9kdO2HH36x60sLEeR0VCVQ== X-Mailru-Sender: FFAA8E4AEE17E37C3731A083A1A85ADEC88F17B4414B44C86B2F5038ED37030BB7EA9FE7735C3DBFC664A44C781FCEA7C77752E0C033A69EDF9F2CE1E9CF805D8CD356D4F938FF726C18EFA0BB12DBB0 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: Alexander Turenko via Tarantool-patches Reply-To: Alexander Turenko Cc: Sergey Bronnikov , tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" > @@ -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. 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.