The attempt to use 'idna' as the codec name has been removed, as Python searches through the registered codecs in the order that they were registered, and the 'encodings' module (which provides the system 'idna') is imported as part of the interpreter start-up, so it will always win.
core.encode / core.decode have been changed so that instead of saying "if the input type is bytes, call s.decode" they say "if the input type is not str, call str(s)". This is important, not least because when you call b'foo'.decode('idna2008'), Python actually passes the codec decode function a memoryview object!
The codec tests file has been considerably expanded so that it will detect all the issues that were fixed, and so that all the codec entry points are tested.
I'm not sure what is up with the mypy tests on Python 3.5 and 3.6, as far as I can tell from the output, the diagnostic they are raising is simply flat-out wrong.
Closes #128, closes #134, closes #138, closes PR #144 (by incorporating it).
The attempt to use 'idna' as the codec name has been removed, as Python searches through the registered codecs in the order that they were registered, and the 'encodings' module (which provides the system 'idna') is imported as part of the interpreter start-up, so it will always win.
core.encode
/core.decode
have been changed so that instead of saying "if the input type is bytes, calls.decode
" they say "if the input type is not str, callstr(s)
". This is important, not least because when you callb'foo'.decode('idna2008')
, Python actually passes the codecdecode
function amemoryview
object!The codec tests file has been considerably expanded so that it will detect all the issues that were fixed, and so that all the codec entry points are tested.