{"push_id":1342667097,"size":1,"distinct_size":1,"ref":"refs/heads/patch-1","head":"c6369000c12a3950e0c02879175d16eb0e5239e3","before":"20aedf90e71d2630e1b3323e45133aa3c42f1b69","commits":[{"sha":"c6369000c12a3950e0c02879175d16eb0e5239e3","author":{"name":"Bruno Rocha","email":"e606396c725d21f185a0ac4ba3d3f633a72be052@users.noreply.github.com"},"message":"Fix unbound method call for JSONEncoder\n\nThe way it is currently it will lead to unbound method error\r\n\r\n```python\r\nIn [1]: import json\r\n\r\nIn [2]: json.JSONEncoder.default('object_here')\r\n---------------------------------------------------------------------------\r\nTypeError                                 Traceback (most recent call last)\r\n<ipython-input-2-872fdacfda50> in <module>()\r\n----> 1 json.JSONEncoder.default('object_here')\r\n\r\nTypeError: unbound method default() must be called with JSONEncoder instance as first argument (got str instance instead)\r\n\r\n```\r\n\r\nBut what is really wanted is to let the json module to raise the \"is not serializable error\" which demands a bounded instance of `JSONEncoder()`\r\n\r\n```python\r\nIn [3]: json.JSONEncoder().default('object_here')\r\n---------------------------------------------------------------------------\r\nTypeError: 'object_here' is not JSON serializable \r\n\r\n```\r\n\r\n\r\nBTW: I think it would try to call `.to_json` of object before raising as it is a common pattern.","distinct":true,"url":"https://api.github.com/repos/rochacbruno/ansible/commits/c6369000c12a3950e0c02879175d16eb0e5239e3"}]}
{"actor":{"display_login":"rochacbruno"}}