You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when I use this lib to dumps some data, it make a puzzled question, sample.log is the minimized data to show it. my python version is 2.7.13 .
pyrapidjson 0.5 + not encode with utf-8
# -*- coding:utf-8 -*-
import codecs
import rapidjson
if __name__ == '__main__':
with codecs.open('sample.log', 'rb', 'utf-8') as f_read:
report_data = [f_read.read(),]
print report_data
report_json = rapidjson.dumps(report_data)
print report_json
it raise a crash about python like:
pyrapidjson 0.5 + encode with utf-8
# -*- coding:utf-8 -*-
import codecs
import rapidjson
if __name__ == '__main__':
with codecs.open('sample.log', 'rb', 'utf-8') as f_read:
report_data = [f_read.read().encode('utf-8'),]
print report_data
report_json = rapidjson.dumps(report_data)
print report_json
it may right like:
pyrapidjson 0.5.1 + not encode with utf-8
# -*- coding:utf-8 -*-
import codecs
import rapidjson
if __name__ == '__main__':
with codecs.open('sample.log', 'rb', 'utf-8') as f_read:
report_data = [f_read.read(),]
print report_data
report_json = rapidjson.dumps(report_data)
print report_json
it like the following picture, no exception but break the string line:
pyrapidjson 0.5.1 + encode with utf-8
# -*- coding:utf-8 -*-
import codecs
import rapidjson
if __name__ == '__main__':
with codecs.open('sample.log', 'rb', 'utf-8') as f_read:
report_data = [f_read.read().encode('utf-8'),]
print report_data
report_json = rapidjson.dumps(report_data)
print report_json
it like the following picture, also no exception but break the string line:
with this condition, I can't know right or not about dumps result. I think it may raise an exception when meet this condition or another way to let user know about this error.
The text was updated successfully, but these errors were encountered:
WangLei1993
changed the title
5.0.1 version, no exception but break the string line when dump some special data
0.5.1 version, no exception but break the string line when dump some special data
Jan 16, 2018
WangLei1993
changed the title
0.5.1 version, no exception but break the string line when dump some special data
version 0.5.1, no exception but break the string line when dump some special data
Jan 16, 2018
when I use this lib to dumps some data, it make a puzzled question, sample.log is the minimized data to show it. my python version is 2.7.13 .
it raise a crash about python like:
it may right like:
it like the following picture, no exception but break the string line:
it like the following picture, also no exception but break the string line:
with this condition, I can't know right or not about dumps result. I think it may raise an exception when meet this condition or another way to let user know about this error.
The text was updated successfully, but these errors were encountered: