Use length from raw encoded string, not unicode version
Also include Python 3.8 in classifiers (now that tested against)
Notes for reviewing
The change switches from incorrectly attempting to determine length of a str/unicode object (str) to the actual bytes object (encoded), or in other words what should be happening is:
Convert Decimal to its string representation (obj => str)
Encode the string as utf-8 (str => encoded)
Write the encoded version into the output buffer (encoded => buffer)
To trigger the assert/crash (as reported in #12):
Uncomment the undef_macros line in setup.py
Undo the fix in encoder.c
Run e.g. (in venv, for specific Python version such as 3.8):
gdb/pdb output is not very informative here because PyBytes_Check is a macro so the backtrace does not confirm the type of input for the macro itself, just the line (which is clear from the asset anyway).
Notes for reviewing
str
) to the actualbytes
object (encoded
), or in other words what should be happening is:Decimal
to its string representation (obj
=>str
)str
=>encoded
)encoded
=>buffer
)undef_macros
line insetup.py
encoder.c
PyBytes_Check
is a macro so the backtrace does not confirm the type of input for the macro itself, just the line (which is clear from the asset anyway).