【发布时间】:2018-04-13 16:24:15
【问题描述】:
我在 Windows 上使用 couchdb 和 couchapp。 我正在从事教授https://github.com/Hypertopic/Tire-a-part 的一个正在进行的项目。我目前正在尝试在我的计算机上设置应用程序。
当我这样做时:
couchapp push http://127.0.0.1:5984/tire-a-part
我收到一个错误:
Traceback (most recent call last):
File "couchapp\dispatch.pyc", line 48, in dispatch
File "couchapp\dispatch.pyc", line 92, in _dispatch
File "couchapp\commands.pyc", line 79, in push
File "couchapp\localdoc.pyc", line 123, in push
File "couchapp\client.pyc", line 294, in save_doc
File "json\__init__.pyc", line 231, in dumps
File "json\encoder.pyc", line 201, in encode
File "json\encoder.pyc", line 264, in iterencode
UnicodeDecodeError: 'utf8' codec can't decode byte 0xe9 in position 1:
invalid continuation byte
我的教授和我的朋友都有mac,没有这个问题。 在网上尝试搜索类似问题几个小时后,我明白这是一个编码错误,但我不明白什么没有正确编码,我应该怎么做。 谢谢
编辑:我发现了 couchapp 的调试选项。它提供了更多细节,但我仍然不太了解,因为这是我第一次使用 couchapp 和 couchdb。这是调试的最后一部分,因为我认为开始并不重要:
2018-04-14 12:42:16 [DEBUG] push spec/samples/scopus.bib
2018-04-14 12:42:16 [DEBUG] push spec/spec_helper.rb
2018-04-14 12:42:16 [DEBUG] Resource uri: http://127.0.0.1:5984/tire-a-part
2018-04-14 12:42:16 [DEBUG] Request: GET _design/Tire-a-part
2018-04-14 12:42:16 [DEBUG] Headers: {'Accept': 'application/json', 'User-
Agent': 'couchapp/0.7.5'}
2018-04-14 12:42:16 [DEBUG] Params: {}
2018-04-14 12:42:16 [DEBUG] Start to perform request: GET 127.0.0.1:5984
/tire-a-part/_design/Tire-a-part
2018-04-14 12:42:16 [DEBUG] Send headers: ['GET /tire-a-part/_design/Tire-a-
part HTTP/1.1\r\n', 'Host: 127.0.0.1:5984\r\n', 'User-Agent:
restkit/3.0.4\r\n', 'Accept-Encoding: identity\r\n', 'Accept:
application/json\r\n']
2018-04-14 12:42:16 [DEBUG] Start to parse response
2018-04-14 12:42:16 [DEBUG] Got response: 404 Object Not Found
2018-04-14 12:42:16 [DEBUG] headers: [MultiDict([('X-CouchDB-Body-
Time','0'),('X-Couch-Request-ID', '5ab9eee6cb'), ('Server', 'CouchDB/2.1.1
(Erlang OTP/18)'), ('Date', 'Sat, 14 Apr 2018 10:42:16 GMT'), ('Content-
Type','application/json'), ('Content-Length', '41'), ('Cache-Control',
'must-revalidate')])]
2018-04-14 12:42:16 [DEBUG] return response class
2018-04-14 12:42:16 [DEBUG] release connection
2018-04-14 12:42:16 [DEBUG] C:\Users\jules\Desktop\LO10 projet\Tire-a-
part\vendor don't exist
2018-04-14 12:42:16 [CRITICAL] 'utf8' codec can't decode byte 0xe9 in
position
1: invalid continuation byte
我将此与我朋友在 mac 上得到的结果进行了比较,除了 [CRITICAL] 行之外,它完全相同。在 'vendordon't exist' couchapp 之后放 _design/Tire-a-part
【问题讨论】:
-
你的同学是否得到相同的
404 Not Found响应? -
是的,好像很正常
-
我在 Linux 上,所以我无法在 Windows 上重现您的问题。但我正在尝试查看
tire-a-part在 Linux 上是否可以正常工作。