unhexlify needs bytes on 3.2. It's kind of annoying.


On 14 April 2014 00:51:58 Mohammed Attia <notifications@github.com> wrote:

> > +    for line in vector_data:
> > +        line = line.strip()
> > +
> > +        if not line or line.startswith("#"):
> > +            continue
> > +
> > +        curve_match = curve_rx.match(line)
> > +        if curve_match:
> > +            curve_name = _ECDSA_CURVE_NAMES[curve_match.group("curve")]
> > +            digest_name = "SHA-{0}".format(curve_match.group("sha"))
> > +
> > +        elif line.startswith("Msg = "):
> > +            if data is not None:
> > +                vectors.append(data)
> > +
> > +            hexmsg = line.split("=")[1].strip().encode("ascii")
>
> Why encode to ascii if you're gonna unhexlify()? ```python
> unhexlify(hexmsg.encode("ascii")) == unhexlify(hexmsg)
> ``` evaluates to ``True``
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/pyca/cryptography/pull/913/files#r11568737