[issue31486] calling a _json.Encoder object raises a SystemError in case obj.items() returned a tuple

2021-11-21 Thread Irit Katriel
Irit Katriel added the comment: Closing as fixed since it's too late to change 3.6 (if that did not happen yet). -- nosy: +iritkatriel ___ Python tracker ___

[issue31486] calling a _json.Encoder object raises a SystemError in case obj.items() returned a tuple

2021-11-21 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed versions: +Python 3.7 -Python 3.6 ___ Python tracker ___

[issue31486] calling a _json.Encoder object raises a SystemError in case obj.items() returned a tuple

2017-11-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: bpo-28280 fixed this issue only in the master branch. I had left this issue open for fixing 3.6. -- resolution: out of date -> stage: resolved -> needs patch status: closed -> open

[issue31486] calling a _json.Encoder object raises a SystemError in case obj.items() returned a tuple

2017-11-07 Thread Berker Peksag
Berker Peksag added the comment: PR 3840 has been merged and it looks like Oren was correct. I'm getting the following output with current master: >>> encoder(obj=BadDict({'spam': 42}), _current_indent_level=4) ['{}'] -- nosy: +berker.peksag resolution: ->

[issue31486] calling a _json.Encoder object raises a SystemError in case obj.items() returned a tuple

2017-10-21 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- stage: -> needs patch versions: +Python 3.6 -Python 3.7 ___ Python tracker ___

[issue31486] calling a _json.Encoder object raises a SystemError in case obj.items() returned a tuple

2017-10-21 Thread Oren Milman
Oren Milman added the comment: ISTM that PR 3840 resolved this issue (as part of bpo-28280). -- ___ Python tracker ___

[issue31486] calling a _json.Encoder object raises a SystemError in case obj.items() returned a tuple

2017-09-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oh, I was aware of this issue for long time, but didn't have good opportunity for fixing it. And yes, making PyMapping_Items() (and friends) always returning a list looks like a reasonable option to me. This could fix similar bugs in third-party extensions.

[issue31486] calling a _json.Encoder object raises a SystemError in case obj.items() returned a tuple

2017-09-15 Thread Oren Milman
New submission from Oren Milman: the following code causes a SystemError: import json.encoder class BadDict(dict): def items(self): return () encoder = json.encoder.c_make_encoder(None, None, None, None, 'foo', 'bar', True, None, None)