Message315297
@serhiy.storchaka while you are doing your overhaul will you please add support for raw json values. I often find myself where I have a serialized object that I want to include in an object response that I'm about to serialize anyway. The implementation should be very simple. Here is my workaround code:
class RawJSON(str): pass
origEnc = json.encoder.encode_basestring_ascii
def rawEnc(obj):
if isinstance(obj, RawJSON):
return obj
return origEnc(obj)
json.encoder.encode_basestring_ascii = rawEnc
https://stackoverflow.com/a/48985560/289240 |
|
Date |
User |
Action |
Args |
2018-04-14 15:53:49 | Zectbumo | set | recipients:
+ Zectbumo, rhettinger, pitrou, ned.deily, ezio.melotti, eric.araujo, Aaron.Staley, serhiy.storchaka, vlcinsky |
2018-04-14 15:53:49 | Zectbumo | set | messageid: <1523721229.86.0.682650639539.issue14573@psf.upfronthosting.co.za> |
2018-04-14 15:53:49 | Zectbumo | link | issue14573 messages |
2018-04-14 15:53:49 | Zectbumo | create | |
|