From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zf90v-0003ct-9h for qemu-devel@nongnu.org; Thu, 24 Sep 2015 12:04:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zf90s-0004hf-49 for qemu-devel@nongnu.org; Thu, 24 Sep 2015 12:04:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38646) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zf90r-0004hX-U4 for qemu-devel@nongnu.org; Thu, 24 Sep 2015 12:04:50 -0400 References: <1442872682-6523-1-git-send-email-eblake@redhat.com> <1442872682-6523-7-git-send-email-eblake@redhat.com> <8737y3g9v0.fsf@blackfin.pond.sub.org> From: Eric Blake Message-ID: <56041F20.7070706@redhat.com> Date: Thu, 24 Sep 2015 10:04:48 -0600 MIME-Version: 1.0 In-Reply-To: <8737y3g9v0.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="b8MPFsuo7XGf1eKKRb72QBmRMBVB0Mqq2" Subject: Re: [Qemu-devel] [PATCH v5 06/46] qapi: Improve 'include' error message List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: marcandre.lureau@redhat.com, DirtY.iCE.hu@gmail.com, qemu-devel@nongnu.org, ehabkost@redhat.com, Michael Roth This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --b8MPFsuo7XGf1eKKRb72QBmRMBVB0Mqq2 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/24/2015 08:39 AM, Markus Armbruster wrote: > Eric Blake writes: >=20 >> Use of '"...%s" % include' to print non-strings can lead to >> ugly messages, such as this (if the .json change is applied >> without the qapi.py change): >> Expected a file name (string), got: OrderedDict() >> >> Better is to just omit the actual non-string value in the >> message. >> >> Signed-off-by: Eric Blake >> --- >> + raise QAPIExprError(expr_info, >> + "Expected a string for 'inclu= de'") >> +++ b/tests/qapi-schema/include-non-file.json >> @@ -1 +1 @@ >> -{ 'include': [ 'foo', 'bar' ] } >> +{ 'include': {} } >=20 > What about "Value of 'include' must be a string'? Sure, the bikeshed looks better in green :) Actually, I like your wording better, so I'll go with it (not too hard, since I already am hoisting this patch to occur before the pep8 cleanups to reduce churn on the message, due to your feedback on 2/46). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --b8MPFsuo7XGf1eKKRb72QBmRMBVB0Mqq2 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWBB8gAAoJEKeha0olJ0Nq4wkH/0G2HckINQLXg4DatCTZiqRO bD3TpLRWURi+l3RCrcpwYi8T/d1SH3uLxOPMywXB9BnG/dm2wlvbmNXalvU/Swv/ RzDJpiWQu1/xFuS7JxRkhPsHIJU5EDNYg1fybUGM1dTuq9lQci/7U0vcFXdz1dbm qwfwIrRnepPFUo6p3Iy7OvYxlX/lezIvfp+tACBhlQh+WaajWE1Bt27wqnN2xd+e 94zxlj1WfehCupT7RTXLkhSCxHd9ilWW9iMU+j5q7JDJXbE7cJ3vH+ITsA6J0P7R Xnypl1bVZi/UPVApmO0WSpsVB7RqHr+DBrupaQYqqF3XXEB1t8w2IKQmepYlLOY= =k6F2 -----END PGP SIGNATURE----- --b8MPFsuo7XGf1eKKRb72QBmRMBVB0Mqq2--