Python中文
首页
教程
问答
标签
搜索
登录
注册
UnicodeEncodeError:灯泡和neo4j create Mod
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>当数据包含非ascii数据时,我试图通过bulls向Neo4J添加数据时,遇到了Unicode错误。在</p> <p>以下代码失败:</p> <pre><code>from bulbs.model import Node from bulbs.property import String from bulbs.neo4jserver import Graph class User(Node): element_type="user" name = String(nullable=False) g = Graph() g.add_proxy("users", User) user_data = {u'name': u'Aname M\xf6ller'} g.users.create(**user_data) </code></pre> <p>使用<code>UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 7: ordinal not in range(128)</code></p> <p>错误发生在<code>bulbs.utils.u</code>函数中,通过<code>codecs.unicode_escape_decode()</code>。在</p> <p>一些希望相关的信息:</p> ^{pr2}$ <p>Neo4J文档<a href="http://docs.neo4j.org/chunked/milestone/graphdb-neo4j-properties.html" rel="nofollow">state</a>所有字符串对象都保存为unicode,那么为什么我的unicode数据不被接受?我希望我只是错过了一些愚蠢的事情。在</p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>是的,这是个虫子。固定在灯泡中0.3.23:</p> <p><a href="https://github.com/espeed/bulbs/commit/7f104cdbc30f27ea76b036cfa0d0a694f074153e" rel="nofollow">https://github.com/espeed/bulbs/commit/7f104cdbc30f27ea76b036cfa0d0a694f074153e</a></p>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
无法使用Django/mongoengine连接到MongoDB(身份验证失败)
5 回答
无法使用Django\u mssql\u后端迁移到外部hos
10 回答
无法使用Django&Python3.4连接到MySql
5 回答
无法使用Django+nginx上载媒体文件
2 回答
无法使用Django1.6导入名称模式
10 回答
无法使用Django1.7和mongodb登录管理站点
7 回答
无法使用Djangoadmin创建项目,进程使用了错误的路径,因为我事先安装了错误的Python
7 回答
无法使用Djangockedi验证CBV中的字段
5 回答
无法使用Djangocketditor上载图像(错误400)
6 回答
无法使用Djangocron进行函数调用
7 回答
无法使用Djangofiler djang上载文件
2 回答
无法使用Djangokronos
5 回答
无法使用Djangomssql provid
3 回答
无法使用Djangomssql连接到带有Django 1.11的MS SQL Server 2016
5 回答
无法使用Djangomssq迁移Django数据库
5 回答
无法使用Djangonox创建用户
10 回答
无法使用Djangopyodb从Django查询SQL Server
6 回答
无法使用Djangopython3ldap连接到ldap
7 回答
无法使用Djangoredis连接到redis
7 回答
无法使用Django中的FK创建新表
8 回答