problems with nmbug and empty prefix (UnicodeWarning and broken pipe)

W. Trevor King wking at tremily.us
Sat Feb 13 14:33:57 PST 2016


On Sat, Feb 13, 2016 at 03:10:16PM -0400, David Bremner wrote:
> bremner at zancas:~$ export NMBGIT=/tmp/nmbug
> bremner at zancas:~$ export NMBPREFIX=""
> bremner at zancas:~$ nmbug commit
> /usr/lib/python2.7/urllib.py:1303: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
>   return ''.join(map(quoter, s))
> Error flushing output: <fd:8>: Broken pipe
> [u'notmuch', u'dump', u'--format=batch-tag', u'--', u'<censored>'] exited with 254

I couldn't reproduce this in either Python 3.4.3 or 2.7.10.  It might
be your number-of-tags hypothesis, but the UnicodeWarning suggests an
encoding issue involving the dump output, which might mean that you
just have a strange tag.  Can you try again with:

  $ nmbug --log-level debug commit

which will give us the full traceback.

We only call ‘notmuch dump …’ from _index_tags, where dump's stdout is
tweaked and fed into ‘git update-index …’.  Your urllib UnicodeWarning
suggests the issue lies in:

  tags = [
      _unquote(tag[len(prefix):])
      for tag in tags_string.split()
      if tag.startswith(prefix)]

in which case it would be useful to try something like:

  tags = []
  for tag in tags_string.split():
      try:
          if tag.startswith(prefix):
              tags.append(_unquote(tag[len(prefix):]))
      except UnicodeWarning as error:
          raise ValueError('{!r} ({!r}, {})'.format(tag, prefix, error))

Cheers,
Trevor

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20160213/7b5235bc/attachment.sig>


More information about the notmuch mailing list