Re: problems with nmbug and empty prefix (UnicodeWarning and broken pipe)
authorW. Trevor King <wking@tremily.us>
Sat, 13 Feb 2016 22:33:57 +0000 (14:33 +1600)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 23:21:07 +0000 (16:21 -0700)
0a/89426b569c881546f571922246d2aeb75ccd6a [new file with mode: 0644]

diff --git a/0a/89426b569c881546f571922246d2aeb75ccd6a b/0a/89426b569c881546f571922246d2aeb75ccd6a
new file mode 100644 (file)
index 0000000..a033598
--- /dev/null
@@ -0,0 +1,154 @@
+Return-Path: <wking@tremily.us>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 15E706DE0AF8\r
+ for <notmuch@notmuchmail.org>; Sat, 13 Feb 2016 14:34:03 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.007\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.007 tagged_above=-999 required=5 tests=[AWL=0.108, \r
+ DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+ RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id V7g9L4rlhmpy for <notmuch@notmuchmail.org>;\r
+ Sat, 13 Feb 2016 14:34:00 -0800 (PST)\r
+Received: from resqmta-po-07v.sys.comcast.net (resqmta-po-07v.sys.comcast.net\r
+ [96.114.154.166])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 876146DE0A9A\r
+ for <notmuch@notmuchmail.org>; Sat, 13 Feb 2016 14:34:00 -0800 (PST)\r
+Received: from resomta-po-12v.sys.comcast.net ([96.114.154.236])\r
+ by resqmta-po-07v.sys.comcast.net with comcast\r
+ id HyZw1s00456HXL001yZzdc; Sat, 13 Feb 2016 22:33:59 +0000\r
+Received: from mail.tremily.us ([73.221.72.168])\r
+ by resomta-po-12v.sys.comcast.net with comcast\r
+ id HyZy1s0033dr3C901yZyuE; Sat, 13 Feb 2016 22:33:59 +0000\r
+Received: by mail.tremily.us (Postfix, from userid 1000)\r
+ id CE4DB1BB149D; Sat, 13 Feb 2016 14:33:57 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tremily.us; s=odin;\r
+ t=1455402837; bh=7GHqRXvYmYpQwbUNtjaYDRr5J5EVQCsTI4Z2p6mf6jk=;\r
+ h=Date:From:To:Cc:Subject:References:In-Reply-To;\r
+ b=T889iVGjuZ7nOAJtKfAXX6qWAP0ao8ExrhjBO3leD5SKK0k6Kf53rcOJRcFyVx5RN\r
+ qZJF0jmLX8pOSVlUOhncdQwXJPMMFrVrAOCK3vnhCvKX3nR/lZk8rfGjodftXhpvl/\r
+ 8pGW1+wddyk3qrwqg9DIU7GekL14spOsxg5CFWLs=\r
+Date: Sat, 13 Feb 2016 14:33:57 -0800\r
+From: "W. Trevor King" <wking@tremily.us>\r
+To: David Bremner <david@tethera.net>\r
+Cc: notmuch@notmuchmail.org\r
+Subject: Re: problems with nmbug and empty prefix (UnicodeWarning and broken\r
+ pipe)\r
+Message-ID: <20160213223357.GC4265@odin.tremily.us>\r
+References: <87oabko293.fsf@zancas.localnet>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; micalg=pgp-sha1;\r
+ protocol="application/pgp-signature"; boundary="OHFW44Kv8gQ39vd8"\r
+Content-Disposition: inline\r
+In-Reply-To: <87oabko293.fsf@zancas.localnet>\r
+OpenPGP: id=39A2F3FA2AB17E5D8764F388FC29BDCDF15F5BE8;\r
+ url=http://tremily.us/pubkey.txt\r
+User-Agent: Mutt/1.5.23 (2014-03-12)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;\r
+ s=q20140121; t=1455402839;\r
+ bh=XfRzmKVUgx89vDSJCDfrjapU9QQiuImEDKht7tJTyC8=;\r
+ h=Received:Received:Received:Date:From:To:Subject:Message-ID:\r
+ MIME-Version:Content-Type;\r
+ b=gvIdFQi0yn5VoiN98kNMq0edOfOGkwuVk7SfGvdL0jcyu/DgI7BpRel/FJrBrEg5U\r
+ llhpoQX3dhFWJGo0AOFjYjp0l9zYCXW4DltsoNO8VRpln3keVf4OWtAyLge/+tZ0jG\r
+ ILL23ABUyd1lydX20sCdTBpHSM0WyVaIT3Z0rFU8rSFN0xP2FKd7Q2aIC7ztLEHds4\r
+ h2SYAQWphcXtQ98vEzCVvC24eaC/MGfCY+boIK5KL60mVpR8hMLTGxarkR0TDatUxi\r
+ 8iN5MDoqqxCSXdQEh5oL4lmX7MH+ZHR5KZrImoQFtHfEm1Tx5nqfKIa47WQTWXbmjG\r
+ mm6KkICfgDfhg==\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 13 Feb 2016 22:34:03 -0000\r
+\r
+\r
+--OHFW44Kv8gQ39vd8\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Disposition: inline\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+On Sat, Feb 13, 2016 at 03:10:16PM -0400, David Bremner wrote:\r
+> bremner@zancas:~$ export NMBGIT=3D/tmp/nmbug\r
+> bremner@zancas:~$ export NMBPREFIX=3D""\r
+> bremner@zancas:~$ nmbug commit\r
+> /usr/lib/python2.7/urllib.py:1303: UnicodeWarning: Unicode equal comparis=\r
+on failed to convert both arguments to Unicode - interpreting them as being=\r
+ unequal\r
+>   return ''.join(map(quoter, s))\r
+> Error flushing output: <fd:8>: Broken pipe\r
+> [u'notmuch', u'dump', u'--format=3Dbatch-tag', u'--', u'<censored>'] exit=\r
+ed with 254\r
+\r
+I couldn't reproduce this in either Python 3.4.3 or 2.7.10.  It might\r
+be your number-of-tags hypothesis, but the UnicodeWarning suggests an\r
+encoding issue involving the dump output, which might mean that you\r
+just have a strange tag.  Can you try again with:\r
+\r
+  $ nmbug --log-level debug commit\r
+\r
+which will give us the full traceback.\r
+\r
+We only call =E2=80=98notmuch dump =E2=80=A6=E2=80=99 from _index_tags, whe=\r
+re dump's stdout is\r
+tweaked and fed into =E2=80=98git update-index =E2=80=A6=E2=80=99.  Your ur=\r
+llib UnicodeWarning\r
+suggests the issue lies in:\r
+\r
+  tags =3D [\r
+      _unquote(tag[len(prefix):])\r
+      for tag in tags_string.split()\r
+      if tag.startswith(prefix)]\r
+\r
+in which case it would be useful to try something like:\r
+\r
+  tags =3D []\r
+  for tag in tags_string.split():\r
+      try:\r
+          if tag.startswith(prefix):\r
+              tags.append(_unquote(tag[len(prefix):]))\r
+      except UnicodeWarning as error:\r
+          raise ValueError('{!r} ({!r}, {})'.format(tag, prefix, error))\r
+\r
+Cheers,\r
+Trevor\r
+\r
+--=20\r
+This email may be signed or encrypted with GnuPG (http://www.gnupg.org).\r
+For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy\r
+\r
+--OHFW44Kv8gQ39vd8\r
+Content-Type: application/pgp-signature; name="signature.asc"\r
+Content-Description: OpenPGP digital signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v2\r
+\r
+iQIcBAEBAgAGBQJWv69TAAoJEAPqygegUbGszXAP/R+P3aTgDj/wHoIY3MYvD6nW\r
+tiz3nr9ifpz1j4RQruMuL69Kf+zAJfifkvHQUxV3Si7eAJV0jD36IhgwmfE2NGVN\r
+ZlGxnr33Ry0orqY7FXLDp+U/Sk4JyjnaAUbYSg0mIByfl2wFB8thcAsZ4W6gGQYc\r
+LpF3BsHV3uoTEU6D1xUv6vLecBMHSOawbEMr66y7ACfaU67ua2eoyJQmOEfi7p1N\r
+9Absy31ovw0BrWb9zYs4I5Zg2fWXL9gv67XUFD3lG2adu44LaNuO6IXcAgF/LTy8\r
+su9+gPQA22bYmJpaUpJ0o8s0rwhJqaM56H7WdOANoXkAFYxITyBuRI4qGHxpGlaH\r
+8FWLa7reYvjTbUMC0s7iJ79GEMhAT0t5F30NT3M+eu2lQOQE5h6do3mbF7UO4T8q\r
+uSkr71ADU++r4xL7MryBZ9g17XN/8dfp0NVllOII95ZwBV1R4Jv0zcNNwVzjDDxz\r
+5BU632OZYK5XzNt/28SsIEo4H5pO0K230PCJ9VzFPdKlq3k7rltwzOUkwKHvSfou\r
+/3Lu6X88k9YbaU91D772N03LVKNaAt8F9pumvqNk3zKF6nt+KRyEIdIVoCfdDfPn\r
+6mwtoNyesgrbF9ypBDEynHYwX3J80wJfOYv9alg3hK6PxS1CwFrfYDPXhNMXcx23\r
+VCO0PFdGY5a1Tt5waR3A\r
+=D2Ya\r
+-----END PGP SIGNATURE-----\r
+\r
+--OHFW44Kv8gQ39vd8--\r