New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken decode() backwards compatibility #9

Closed
cwillu opened this Issue Aug 19, 2014 · 2 comments

Comments

Projects
None yet
2 participants
@cwillu

cwillu commented Aug 19, 2014

Previously, demjson.decode() was documented as having the following signature:

decode(txt, strict=False, encoding=None, **kw)

Now it has the following signature:

decode(txt, encoding=None, **kw)

This breaks code that assumes that strict is the second positional keyword.

Additionally, the resulting error is non-obvious:

>>> demjson.decode('{}', True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/demjson.py", line 5701, in decode
    return_stats=(return_stats or write_stats) )
  File "/usr/local/lib/python2.7/dist-packages/demjson.py", line 4917, in decode
    raise errors[0]
demjson.JSONDecodeError: a Unicode decoding error occurred
@dmeranda

This comment has been minimized.

Show comment
Hide comment
@dmeranda

dmeranda Aug 20, 2014

Owner

What version were you coming from and going to? From 1.x to 2.x, or something different?

Note that demjson 2.0 was a major release that introduced many backwards incompatibilities from 1.x versions. I attempted to document everything, though this particular function signature change may not have been.

You can read about most of the changes here:
http://deron.meranda.us/python/demjson/changes

Owner

dmeranda commented Aug 20, 2014

What version were you coming from and going to? From 1.x to 2.x, or something different?

Note that demjson 2.0 was a major release that introduced many backwards incompatibilities from 1.x versions. I attempted to document everything, though this particular function signature change may not have been.

You can read about most of the changes here:
http://deron.meranda.us/python/demjson/changes

@dmeranda dmeranda added wontfix and removed wontfix labels Nov 11, 2014

@dmeranda

This comment has been minimized.

Show comment
Hide comment
@dmeranda

dmeranda Nov 12, 2014

Owner

Closing.

Owner

dmeranda commented Nov 12, 2014

Closing.

@dmeranda dmeranda closed this Nov 12, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment