Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/348.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
Python __init_u;()只接受1个参数(给定3个)Google应用程序引擎_Python_Google App Engine_Google Cloud Messaging - Fatal编程技术网

Python __init_u;()只接受1个参数(给定3个)Google应用程序引擎

Python __init_u;()只接受1个参数(给定3个)Google应用程序引擎,python,google-app-engine,google-cloud-messaging,Python,Google App Engine,Google Cloud Messaging,我一直在上传我的app engine应用程序的新版本,上传后,当我提出请求时,我得到以下回复: __init__() takes exactly 1 argument (3 given) Traceback (most recent call last): File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1511, in __call

我一直在上传我的app engine应用程序的新版本,上传后,当我提出请求时,我得到以下回复:

__init__() takes exactly 1 argument (3 given)
Traceback (most recent call last):
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1511, in __call__
    rv = self.handle_exception(request, response, e)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1505, in __call__
    rv = self.router.dispatch(request, response)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1253, in default_dispatcher
    return route.handler_adapter(request, response)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1076, in __call__
    handler = self.handler(request, response)
TypeError: __init__() takes exactly 1 argument (3 given)
我根本不知道该怎么做,我已经对我的部分代码进行了注释,取消了注释,我已经将代码上传到我拥有的不同的GAE应用程序,甚至是这些应用程序的多个版本

我甚至不知道从哪里开始,谁能告诉我这个错误可能意味着什么?我将提供您要求的任何信息,提前感谢您

编辑: 这就是我添加的处理程序的外观:

class GCMRegister(webapp2.RequestHandler):
    def post(self):
        regid = self.request.get("regId")
        if not regid:
            self.response.out.write('Must specify regid')
        else:
            u = usuario()
            u.name = "deadlybacon" # ax_length = 140)
            u.mail = "testmail@hotmail.com" # (max_length = 256, db_index = True
            u.password = "password" #max_length = 140)
            u.put()
            u.push_key(regid)
我的WSGI应用程序如下所示:

application = webapp2.WSGIApplication([
    ('/', MainPage),

    ('/indexData', indexData),
    ('/ajaxLogIn', ajaxLogIn),
    ('/createGroup', createGroup),
    ('/masterServices', masterServices),
    ('/groupInfo', groupInfo),
    ('/groupInviteTo', groupInviteTo),
    ('/acceptNotif', acceptNotif),
    ('/adventureCreate', createAdventure),  
    ('/adventureAppointTo', adventureAppointTo), 
    ('/addNewPrueba', addNewPrueba), 
    ('/listPoolPruebas', listPoolPruebas), 
    ('/addExistingPrueba', addExistingPrueba), 

    ('/gcm/register', GCMRegister),

]) #, debug=True, config = config)
起初,我假设它是调试和配置,这就是为什么我对它进行了注释,这没有什么区别,无论发生什么,都会发生相同的错误

class HomeHandler(webapp2.RequestHandler):
    def __init__(self, request, response):
        self.initialize(request, response)
        ...

你的处理者长什么样?我想你忘了把
请求
响应
参数添加到你的类
\uuuuuu初始化
方法中了,就像其他处理程序一样,我只是困惑idk发生了什么,处理程序是如何注册的?@DeadlyBacon:你在
GCMRegister
类上定义了其他方法吗?还有@MartijnPieters我不确定我是否理解你的问题,你的意思是像我的webapp2.WSGIApplication一样吗?