json.loads(s) returns error message like this: ValueError: Invalid control character at: line 1 column 33 (char 33)
json.loads(s) returns error message like this:
ValueError: Invalid control character at: line 1 column 33 (char 33)
According to http://docs.python.org/2/library/json.html
"If strict is False (True is the default), then control characters will be allowed inside strings. Control characters in this context are those with character codes in the 0-31 range, including '\t' (tab), '\n', '\r' and '\0'."
For example:
json.loads(json_str, strict=False)
json.loads(s) returns error message like this: ValueError: Invalid control character at: line 1 column 33 (char 33)的更多相关文章
- json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
1.json模块常用的四个函数 import json json.load() # 将一个存储在文件中的json对象(str)转化为相对应的python对象 json.loads() # 将一个jso ...
- SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data错误的解决
记录个报错: 问题描述: 经过服务器生成图片返到前台时,在火狐浏览器中下载图片或打开图片时报错:SyntaxError: JSON.parse: unexpected character at lin ...
- jQuery解析JSON出现SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data
SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data 我在使用$.parseJSON解析后 ...
- 【Maven错误】 Non-resolvable parent POM for ...... Return code is: 500 , ReasonPhrase:Internal Server Error. and 'parent.relativePath' points at no local POM @ line 14, column 11
一.异常信息 [INFO] Scanning for projects... Downloading: http://www.myhost.com/maven/jdk18/org/springfram ...
- 记录一个奇葩 bug [Failed to decode JSON object: Expecting value: line 1 column 1 (char 0)]
关于 flask 的一个记录 代码 @auth.login_required @app.route('/add', methods=['POST']) def add(): if request.me ...
- iOS解析JSON字符串报错Error Domain=NSCocoaErrorDomain Code=3840 "Invalid escape sequence around character 586."
将服务器返回的JSON string转化成字典时报错: Error Domain=NSCocoaErrorDomain Code=3840 "Invalid escape sequence ...
- python json模块出现Invalid control character这个异常的原因
今天在查看日志的时候,发现一个问题,觉得很奇怪,跑了一个多月的代码突然报错了,还是个没见过的错误. 所以今晚抽空记录下. 一.重现错误 说好的传过来的数据是json格式的呢?怎么会突然报错了呢? 二. ...
- python,json解析字符串时ValueError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
今天写测试工具的时候,去excel取数据,用json解析字符串为字典时报错,后经调试,发现是单引号的原因,将单引号换位双引号即可 def getExcelValue_to_dic(filepath): ...
- Python中使用json.loads解码字符串时出错:ValueError: Expecting property name: line 1 column 1 (char 1)
解决办法,json数据只能用双引号,而不能用单引号
随机推荐
- centos7 rabbitmq 安装
http://www.rabbitmq.com/install-rpm.html Overview rabbitmq-server is included in Fedora. However, th ...
- Xshell高级后门完整分析报告(ZT)
1. 前言 近日,Xshell官方发布公告称其软件中存在后门.我们的实习生同学对该后门进行了详细的分析,确认这是一个具备恶意代码下载执行和数据回传等能力的高级木马. 后门代码存在于nssock2.dl ...
- Java进阶2 数组内存和对象的内存管理知识
Java进阶2 数组内存和对象的内存管理知识 20131028 前言: 在面试的时候,如果是Java的编程语言,也许你认为没有什么可以问的,只能够说明你对于Java了解的太浅了,几乎就是两个星期的节奏 ...
- USB events thread - failed to set priority
ubuntu + openni + nite,出现 Warning:USB events thread - failed to set priority xn::ImageGenerator imag ...
- Prism 4 文档 ---第6章 高级MVVM场景
在上一章中描述了如何通过将UI,表现逻辑,业务逻辑分别放到三个单独的类中(View,View Model,Model),实现这些类之间的交互(通过数据绑定,命令以及数据验证接口)以及实现一个策 ...
- SQL HAVING用法详解
来自:http://blog.csdn.net/wozeze1/article/details/6031318 HAVING 子句对 GROUP BY 子句设置条件的方式与 WHERE 和 SELEC ...
- 天气预报api整理
目录 1.国家气象局提供的天气预报接口 1.1.接口网址 1.2.示范代码 2.各个城市对应的代码 作为一个开发的diaosi,在开发过程中,时常会遇到添加天气的功能,现在百忙之中抽出一点时间整理了一 ...
- Linux内核源代码目录结构详解
http://blog.csdn.net/u013014440/article/details/44024207
- 【HEVC学习与研究】29、解码第一个Coding Quadtree结构(1)
ctu tree属性 http://blog.csdn.net/shaqoneal/article/details/26088817
- (转)MapReduce Design Patterns(chapter 1)(一)
翻译的是这本书: Chapter 1.Design Patterns and MapReduce MapReduce 是一种运行于成百上千台机器上的处理数据的框架,目前被google,Hadoop等多 ...