codecs.decode() unexpected interpreter error

Issue #3001 resolved
abara_kedavra created an issue

import codecs

bytes = codecs.decode(string, "hex")

"TypeError: 'hex' decoder returned 'bytes' instead of 'str'; use codecs.decode() to decode to arbitrary types"

But it must return bytes, and I expect bytes (?!) This is not a type error. Can someone explain why this is happening? There is no such problem with CPython. (+ Ubuntu 18.04 / PyCharm)

Comments (3)

  1. Log in to comment