我正在尝试在 Dropbox 中获取站点,主要是为了弄清楚如何在 appengine 上使用 Dropbox。
python: c:\Program Files (x86)\Google\google_appengine>python Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win 32
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\webapp\_webapp25.py", line 701, in __call__
handler.get(*groups)
File "C:\youiestsiteinadropbox\siteinadropbox\handlers\dropboxhandlers.py", line 38, in new_f
f(self, *args, **kwargs)
File "C:\youiestsiteinadropbox\siteinadropbox\handlers\dropboxhandlers.py", line 65, in get
self.dropbox_auth_callback(self.site)
File "C:\youiestsiteinadropbox\siteinadropbox\handlers\dropboxhandlers.py", line 118, in dropbox_auth_callback
access_token = models.Site.dropbox_auth.obtain_access_token(token, "")
File "C:\youiestsiteinadropbox\dropbox\auth.py", line 177, in obtain_access_token
self.oauth_request.sign_request(self.signature_method_hmac_sha1, self.consumer, token)
File "C:\youiestsiteinadropbox\oauth\oauth.py", line 259, in sign_request
self.build_signature(signature_method, consumer, token))
File "C:\youiestsiteinadropbox\oauth\oauth.py", line 263, in build_signature
return signature_method.build_signature(self, consumer, token)
File "C:\youiestsiteinadropbox\oauth\oauth.py", line 634, in build_signature
hashed = hmac.new(key, raw, sha)
File "C:\Python27\lib\hmac.py", line 133, in new
return HMAC(key, msg, digestmod)
File "C:\Python27\lib\hmac.py", line 72, in __init__
self.outer.update(key.translate(trans_5C))
TypeError: character mapping must return integer, None or unicode
应用程序内的最后一次调用是:
文件“C:\youiestsiteinadropbox\siteinadropbox\handlers\dropboxhandlers.py”,第 118 行,在 dropbox_auth_callback access_token = models.Site.dropbox_auth.obtain_access_token(token, "")
将此部分转换为 unicode 并没有多大成功。关于如何在 appengine 上开始使用 Dropbox 的任何想法或其他指示?提前致谢。