1

我已经在 facebook 上的应用程序上创建,但我面临填充问题。问题如下。

    Traceback (most recent call last):
  File "/app/lib/python2.7/site-packages/flask/app.py", line 1306, in __call__
    return self.wsgi_app(environ, start_response)
  File "/app/lib/python2.7/site-packages/flask/app.py", line 1294, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/app/lib/python2.7/site-packages/flask/app.py", line 1292, in wsgi_app
    response = self.full_dispatch_request()
  File "/app/lib/python2.7/site-packages/flask/app.py", line 1062, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/app/lib/python2.7/site-packages/flask/app.py", line 1060, in full_dispatch_request
    rv = self.dispatch_request()
  File "/app/lib/python2.7/site-packages/flask/app.py", line 1047, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/app/exampleapp.py", line 167, in index
    access_token = get_token()
  File "/app/exampleapp.py", line 134, in get_token
    data = json.loads(urlsafe_b64decode(str(encoded_data[1])))
  File "/usr/local/lib/python2.7/base64.py", line 112, in urlsafe_b64decode
    """
  File "/usr/local/lib/python2.7/base64.py", line 76, in b64decode

TypeError: Incorrect padding

谁能帮我解决这个问题。

4

1 回答 1

0

你能用 pdb 告诉我们 exampleapp.py 第 134 行中的 encoded_data[1] 是什么吗?

这只是 base64 编码的一些问题,可能是一些必须使用 .strip() 去除的空格(我会尝试)。但如果没有看到它的价值,就很难猜到。(对不起,这是评论而不是答案,但我还不能评论)。

于 2012-09-20T18:23:34.790 回答