Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/321.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Web应用程序中的内部服务器错误:使用Python的Google应用程序引擎中的Google Latitude API_Python_Google App Engine - Fatal编程技术网

Web应用程序中的内部服务器错误:使用Python的Google应用程序引擎中的Google Latitude API

Web应用程序中的内部服务器错误:使用Python的Google应用程序引擎中的Google Latitude API,python,google-app-engine,Python,Google App Engine,我是python和Google应用程序引擎的新手。我目前正在开发一个基于位置的web应用程序,我使用了以下示例代码 我能够在本地主机上运行该程序,但是当我部署该程序并尝试访问该网站时,会收到一条内部服务器错误消息 我查看了App Engine日志文件,如下所示: argument 2 to map() must support iteration Traceback (most recent call last):File"/base/python_runtime/python_lib/vers

我是python和Google应用程序引擎的新手。我目前正在开发一个基于位置的web应用程序,我使用了以下示例代码

我能够在本地主机上运行该程序,但是当我部署该程序并尝试访问该网站时,会收到一条内部服务器错误消息

我查看了App Engine日志文件,如下所示:

argument 2 to map() must support iteration
Traceback (most recent call last):File"/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line 700, in __call__
handler.get(*groups)
File "/base/data/home/apps/s~latitudesocial/1.351807357650160822/main.py", line 57, in get
self.request.host_url + OAUTH_CALLBACK_PATH, parameters)
File "/base/data/home/apps/s~latitudesocial/1.351807357650160822/oauth_webapp.py", line 28, in redirect_to_authorization_page
request_token = helper.GetRequestToken(callback_url, parameters)
File "/base/data/home/apps/s~latitudesocial/1.351807357650160822/oauth_appengine.py", line 78, in GetRequestToken
None)
File "/base/data/home/apps/s~latitudesocial/1.351807357650160822/oauth.py", line 262, in sign_request
self.build_signature(signature_method, consumer, token))
File "/base/data/home/apps/s~latitudesocial/1.351807357650160822/oauth.py", line 266, in build_signature
return signature_method.build_signature(self, consumer, token)
File "/base/data/home/apps/s~latitudesocial/1.351807357650160822/oauth.py", line 632, in build_signature
oauth_request, consumer, token)
File "/base/data/home/apps/s~latitudesocial/1.351807357650160822/oauth.py", line 623, in build_signature_base_string
key = '%s&' % escape(consumer.secret)
File "/base/data/home/apps/s~latitudesocial/1.351807357650160822/oauth.py", line 50, in escape
return urllib.quote(s, safe='~')
File "/base/python_runtime/python_dist/lib/python2.5/urllib.py", line 1214, in quote
res = map(safe_map.__getitem__, s)
TypeError: argument 2 to map() must support iteration
我自己一直在努力想办法解决这个问题,但到目前为止我没有取得任何进展

我猜oauth.py中的623行有问题

如果可以,请帮我找到错误

    $key = '%s&' % escape(consumer.secret)
我对main.py所做的更改是:

class SetMyOauth(webapp.RequestHandler): 
    def get(self): 
        Config.set('oauth_consumer_key', 'myconsumerkey'), 
        Config.set('oauth_consumer_secret', 'myconsumersecret'), 
        self.response.out.write ("""key and secret set""") 
更新17/7/2011

经过进一步询问,我在运行调试器时遇到了以下错误

C:\Python25\lib\threading.py:699: RuntimeWarning: tp_compare didn't return -1 or -2 for exception
  return _active[_get_ident()]
Exception exceptions.SystemError: 'error return without exception set' in <generator object at 0x03C41378> ignored
与日志文件中记录的代码相同


但是,当我使用开发服务器运行代码时,应用程序运行正常,没有错误。

看起来您正在为consumer.secret传递一个值,该值不是字符串,但如果不查看相关的源代码,则无法确定。你能编辑这个问题来添加它吗?我已经使用了这里的代码
def escape(s):
    """Escape a URL including any /."""
    return urllib.quote(s, safe='~')