File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ def json_default(obj):
111
111
return obj .isoformat ().replace ('+00:00' , 'Z' )
112
112
113
113
if isinstance (obj , bytes ):
114
- return b2a_base64 (obj ).decode ('ascii' )
114
+ return b2a_base64 (obj , newline = False ).decode ('ascii' )
115
115
116
116
if isinstance (obj , Iterable ):
117
117
return list (obj )
@@ -157,7 +157,7 @@ def json_clean(obj):
157
157
if isinstance (obj , bytes ):
158
158
# unanmbiguous binary data is base64-encoded
159
159
# (this probably should have happened upstream)
160
- return b2a_base64 (obj ).decode ('ascii' )
160
+ return b2a_base64 (obj , newline = False ).decode ('ascii' )
161
161
162
162
if isinstance (obj , container_to_list ) or (
163
163
hasattr (obj , '__iter__' ) and hasattr (obj , next_attr_name )
Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ def test_json_default():
166
166
(True , None ),
167
167
(False , None ),
168
168
(None , None ),
169
- ({"key" : b"\xFF " }, {"key" : "/w==\n " }),
169
+ ({"key" : b"\xFF " }, {"key" : "/w==" }),
170
170
# Containers
171
171
([1 , 2 ], None ),
172
172
((1 , 2 ), [1 , 2 ]),
You can’t perform that action at this time.
0 commit comments