Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o, Alec Warner <antarus@g.o>
Cc: Zac Medico <zmedico@g.o>
Subject: Re: [gentoo-portage-dev] [PATCH] filter-bash-environment.py: use buffered input, raw bytes (bug 647654)
Date: Thu, 15 Feb 2018 06:01:07
Message-Id: 47b4abc1-3100-81da-817b-76595ece489c@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [PATCH] filter-bash-environment.py: use buffered input, raw bytes (bug 647654) by Alec Warner
1 On 02/14/2018 12:46 PM, Alec Warner wrote:
2 > On Wed, Feb 14, 2018 at 3:38 PM, Zac Medico <zmedico@g.o
3 > <mailto:zmedico@g.o>> wrote:
4 >
5 > Use sys.stdin.buffer instead of sys.stdin.buffer.raw, for buffered
6 > input.
7 > Also use raw bytes instead of unicode strings, in order to avoid making
8 > assumptions about character encodings, and also to avoid overhead from
9 > unicode decoding/encoding.
10 >
11 >
12 > Maybe a functional test?
13
14 In PATCH v2 I've added a unit test that compares expected output to
15 actual output.
16
17 > take real environment, check it into source code, run filter over it to
18 > get output, run bash -n on output?
19 >
20 > Better ideas?
21
22 We already have a number of tests that do the equivalent with a complete
23 ebuild.sh by calling emerge. The resulting environment is sourced, and
24 that will fail if the bash syntax is invalid. All of those tests failed
25 for python3.4 here because it doesn't support the % operator with bytes
26 operands:
27
28 https://travis-ci.org/gentoo/portage/jobs/341614451
29 --
30 Thanks,
31 Zac

Attachments

File name MIME type
signature.asc application/pgp-signature