From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <gentoo-portage-dev+bounces-3024-garchives=archives.gentoo.org@lists.gentoo.org> Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id F36241381F3 for <garchives@archives.gentoo.org>; Tue, 22 Oct 2013 15:59:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8E47BE0A03; Tue, 22 Oct 2013 15:59:39 +0000 (UTC) Received: from mail-ee0-f51.google.com (mail-ee0-f51.google.com [74.125.83.51]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CA571E09F6 for <gentoo-portage-dev@lists.gentoo.org>; Tue, 22 Oct 2013 15:59:38 +0000 (UTC) Received: by mail-ee0-f51.google.com with SMTP id d41so997483eek.38 for <gentoo-portage-dev@lists.gentoo.org>; Tue, 22 Oct 2013 08:59:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:user-agent:references:in-reply-to:mime-version :content-type:content-transfer-encoding:message-id; bh=mSyOG/XTIdlfN9vOFtgJ+TghWzJH26bwMffH+M1XpqU=; b=eszX9CwZyotciItF8yFecA88wTdSGyhwnxevBjcU9Tg0y2HmFFpT8+VyipSnsJdT5/ vKMwiG6EB73/9U/q+kkWkFEQwvAKMyq7Ttp5aj+pNcu1u+CKaZLxRnXkrIZf+vIvdjR4 NksqnFQIqTrFslgMgi3QjpKsrV8bSAl+1N7h3sdyDqUBsY8BJgkTTCMUCnlP6HpgoBlu rXZpJp3KGNUGq9EsA+s83lhkKdjXDlHD2PHxFqn5yp8rEeuXcDyE9ZT7/1o1xurK1vVb v2Nn3Z1rS4kHddzhePiehKkH11XdJ+yuo0ahChw0sxcu94ceu9HbYzr29eetVYfdJ0y3 f/+w== X-Received: by 10.14.2.200 with SMTP id 48mr903580eef.88.1382457577175; Tue, 22 Oct 2013 08:59:37 -0700 (PDT) Received: from afta-picea.localnet (202-141-251-94.net.stream.pl. [94.251.141.202]) by mx.google.com with ESMTPSA id h45sm58407970eeg.5.2013.10.22.08.59.35 for <gentoo-portage-dev@lists.gentoo.org> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Oct 2013 08:59:36 -0700 (PDT) From: Arfrever Frehtes Taifersar Arahesis <arfrever.fta@gmail.com> To: Gentoo Portage Development <gentoo-portage-dev@lists.gentoo.org> Subject: Re: [gentoo-portage-dev] [PATCH] xattr: centralize the various shims in one place Date: Tue, 22 Oct 2013 17:59:03 +0200 User-Agent: KMail (GNU/Linux) References: <1381957406-21749-1-git-send-email-vapier@gentoo.org> <201310170542.26667.Arfrever.FTA@gmail.com> <201310202300.07264.vapier@gentoo.org> In-Reply-To: <201310202300.07264.vapier@gentoo.org> Precedence: bulk List-Post: <mailto:gentoo-portage-dev@lists.gentoo.org> List-Help: <mailto:gentoo-portage-dev+help@lists.gentoo.org> List-Unsubscribe: <mailto:gentoo-portage-dev+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:gentoo-portage-dev+subscribe@lists.gentoo.org> List-Id: Gentoo Linux mail <gentoo-portage-dev.gentoo.org> X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3146190.iN6k2kv1Kj"; protocol="application/pgp-signature"; micalg=pgp-sha512 Content-Transfer-Encoding: 7bit Message-Id: <201310221759.05197.Arfrever.FTA@gmail.com> X-Archives-Salt: 24310441-1698-487c-bc4d-c67144605e2a X-Archives-Hash: 46777bf4c4da44fd18102ca0bbcde342 --nextPart3146190.iN6k2kv1Kj Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 2013-10-21 05:00 Mike Frysinger napisa=C5=82(a): > On Wednesday 16 October 2013 23:42:26 Arfrever Frehtes Taifersar wrote: > > - cStringIO module should not be used. io module is a replacement avail= able > > since Python 2.6. >=20 > unfortunately, that doesn't work as well as it should. python 2.7's inte= rface=20 > is annoyingly different when using other python 2.7 modules. i'll have t= he=20 > code import the old module and then fallback to using the new io module. (io.StringIO works only with unicode strings. When bytes-compatible functions are really needed, then io.BytesIO can be u= sed, which works only with bytes. cStringIO.StringIO is designed to work with bytes, but cStringIO.StringIO()= =2Ewrite(instance_of_unicode) implicitly encodes its argument to bytes.) In your another patch, portage.tests.bin.test_prepstrip.PrepStripFull._prep= strip() passes an instance of cStringIO.StringIO class to portage.bin.prepstrip.main(), which passes it t= o portage.bin.prepstrip.Prepstrip(), which passes it to print(), portage.elog.messages.eqawarn() and portage.elo= g.messages.ewarn(). pym/portage/bin/prepstrip.py should have: from __future__ import unicode_literals Then print('...', file=3Dout) calls will work with an instance of io.String= IO class. (portage.elog.messages.eqawarn() and portage.elog.messages.ewarn() internal= ly decode message, so they already work with out=3Dio.StringIO, but not out=3Dio.BytesIO.) =2D- Arfrever Frehtes Taifersar Arahesis --nextPart3146190.iN6k2kv1Kj Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAABCgAGBQJSZqDJAAoJEA1v8+vOu0V0CvsQAJZmu2H1JZzVonxSK2ZcSQm8 O0eUpKgK7W5uxATiNUp6libDOh2ULWN6WgesPU0tUwFVMysBisWqbSdLEjmy4Mfw wOZEzv+/P312+O4G+/2vzcxGxuiF5CQAyJGhG0cepB68B8MZFLHxfw47uk6bvBo8 a4oeh0eZepKsLnGIjoH4MrVWFP2GRSNnN5v2+E0WU+EBhNXnKbUPltuFZlAWtN37 ZHXmI7m1jQtImkrB6ZzK8PRn5iiXbtiu063YM5TgR1RC4yICiXZQI9TgN6aMD8wr IRxZHnYcdn8KjzCD8/N9AOw6TteV7ijvf4ujNBNCH3/rOC+GVjRZoylmJksoGLdy lcD902HNFMZ+U8HmEIXBobNaXkwrDQFjBCInsWg6LpwNsCFwCk6NE/uldN47d/hs kNiC/yBmGpuYlu/ahauYNSzV2MDFutR73NdXB000nIFtUzBYVMISdiYFRkvXjVH3 OD+osOMRrUc7AEC86ac5dlYuW/nQ2rhmbaE4/eP/RsCEHe8TiEhVj33VGXeYFnEb mj6oikFUzYJ87HRN0wf6/vWWEceRmlJPyNGtpDKOU58I9kTqBVsibp1ZOWYMscDv XEnnR04Qx5yLce7KLc2igpHTyG57KgcoIgVGS6E5NkHyFTjDtrHToo0QLFYXYuf9 3ceFby144wOAQF5TFXF2 =UTDT -----END PGP SIGNATURE----- --nextPart3146190.iN6k2kv1Kj--