Iotic-Labs / py-ubjson

Universal Binary JSON draft-12 serializer for Python
Apache License 2.0
42 stars 12 forks source link

DecoderException does not include offset (extension only) #10

Closed vtermanis closed 5 years ago

vtermanis commented 5 years ago

DecoreException expects an optional parameter fp to be a file-like object with tell() function. In the C extension however the exception is initialised with the integer position in the stream. This means that currently exceptions raised via C extension never show stream offset.

Potential fixes:

  1. Allow for DecoreException to accept either an integer or file-like object as argument
  2. Update pure Python version to supply integer offset, change DecoderException to expect an integer rather than file-like object.
vtermanis commented 5 years ago

Fixed in 0.14.0.