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

David Bremner david at tethera.net
Sun Feb 14 04:22:24 PST 2016


"W. Trevor King" <wking at tremily.us> writes:


> On Sat, Feb 13, 2016 at 10:41:40PM -0400, David Bremner wrote:
>> Traceback (most recent call last):
>>   File "/home/bremner/.config/scripts/nmbug.real", line 834, in <module>
>>     args.func(**kwargs)
>>   File "/home/bremner/.config/scripts/nmbug.real", line 324, in commit
>>     status = get_status()
>>   File "/home/bremner/.config/scripts/nmbug.real", line 581, in get_status
>>     index = _index_tags()
>>   File "/home/bremner/.config/scripts/nmbug.real", line 621, in _index_tags
>>     git.stdin.write(line)

>
> This traceback is pointing at what should be a stream write, so I
> don't see how urllib is involved there at all.  I guess this traceback
> ends up in the “Broken pipe” message from your original post?

yes

>
>   for tag in tags:
>       _LOG.debug('building a quoted path for {!r} / {!r}'.format(id, tag))
>       path = 'tags/{id}/{tag}'.format(
>           id=_hex_quote(string=id), tag=_hex_quote(string=tag))
>       yield '{mode} {hash}\t{path}\n'.format(mode=mode, hash=hash, path=path)
>

I think the problem is not a bad tag, but a bad message-id. The last
line of output before the UnicodeWarning and the broken pipe is

building a quoted path for u'D1B4DEBCAFFC4A05A4D4349A6EC5C9D8@\xd1\xe5\xf0\xe3\xe5\xe9-\xcf\xca' / u'unread'

this corresponds to

      id:D1B4DEBCAFFC4A05A4D4349A6EC5C9D8@Ñåðãåé-ÏÊ

The original header looks like

    Message-ID: <D1B4DEBCAFFC4A05A4D4349A6EC5C9D8@Ñåðãåé-ÏÊ>

Visually I can't see what the encoding error might be, but I guess that
doesn't matter; we should be able to handle message-ids as opaque byte
strings.

d


More information about the notmuch mailing list