Oh oh oh.
/me derps
I'll fix that.
On Jun 2, 2014 11:30 AM, "Mangled Deutz" <notifications@github.com> wrote:

> In docker_registry/lib/xtarfile.py:
>
> > +    # the newline. keyword and value are both UTF-8 encoded strings.
> > +    regex = re.compile(r"(\d+) ([^=]+)=", re.U)
> > +    pos = 0
> > +    while True:
> > +        match = regex.match(buf, pos)
> > +        if not match:
> > +            break
> > +
> > +        length, keyword = match.groups()
> > +        length = int(length)
> > +        value = buf[match.end(2) + 1:match.start(1) + length - 1]
> > +
> > +        try:
> > +            keyword = keyword.decode("utf8")
> > +        except Exception:
> > +            keyword = keyword
>
> Hear hear (about raw-bytes and unicode).
>
> My point is keyword = keyword does absolutely nothing :-) - and if decode
> fails, you will get the raw bytes no matter what.
>
> Suggestion:
>
> try:
> keyword = keyword.decode("utf8")
> except:
> pass
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/dotcloud/docker-registry/pull/381/files#r13290266>.
>