help migrating from python2.5 to python2.7

202 views
Skip to first unread message

Kwame

unread,
Apr 6, 2012, 9:28:51 AM4/6/12
to google-a...@googlegroups.com
I'm trying to migrate my app to python2.7 and so far it's been a nightmare! My latest issue is that I'm getting this error:

Traceback (most recent call last):
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 1536, in __call__
    rv = self.handle_exception(request, response, e)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 1530, in __call__
    rv = self.router.dispatch(request, response)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 1278, in default_dispatcher
    return route.handler_adapter(request, response)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 1101, in __call__
    handler = self.handler(request, response)
TypeError: __init__() takes exactly 1 argument (3 given)
I'm not sure where to start with debugging this. is this a bug? Please help.

Brian Quinlan

unread,
Apr 6, 2012, 4:13:28 PM4/6/12
to google-a...@googlegroups.com
Hi,

Is that the complete traceback? It doesn't seem to include the entry
point into your code.

Cheers,
Brian

> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-appengine/-/vARS7lQZe9oJ.
> To post to this group, send email to google-a...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengi...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.

Kwame

unread,
Apr 6, 2012, 4:22:18 PM4/6/12
to google-a...@googlegroups.com
Your right. I was missing the first line of the Traceback.



ERROR
2012-04-06 20:19:30,612 webapp2.py:1553] __init__() takes exactly 1 argument (3 given)

Traceback (most recent call last):

 
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 1536, in __call__

 rv
= self.handle_exception(request, response, e)

 
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 1530, in __call__

 rv
= self.router.dispatch(request, response)

 
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 1278, in default_dispatcher

 
return route.handler_adapter(request, response)

 
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2/webapp2.py", line 1101, in __call__

 handler
= self.handler(request, response)

TypeError: __init__() takes exactly 1 argument (3 given)


INFO
2012-04-06 20:19:30,648 dev_appserver.py:2884] "GET / HTTP/1.1" 500 -

INFO
2012-04-06 20:19:30,767 dev_appserver.py:2884] "GET /favicon.ico HTTP/1.1" 200 -


On Friday, April 6, 2012 4:13:28 PM UTC-4, Brian Quinlan wrote:
Hi,

> To post to this group, send email to google-appengine@googlegroups.com.


> To unsubscribe from this group, send email to

Kwame

unread,
Apr 6, 2012, 10:26:25 PM4/6/12
to google-a...@googlegroups.com

Figured it out!

App using Python (Old way)

import webapp
import logging
_URLS
= [(r'/path/(.*)/(.*)', handlers.Handler)]

    application
= webapp.WSGIApplication(_URLS, debug=True)
    util
.run_wsgi_app(application)

if __name__ == '__main__':

    main
()




App using Python2.7

import webapp2
import logging
_URLS
= [webapp2.Route(r'/path/(.*)/(.*)', handlers.Handler)]
application
= webapp2.WSGIApplication(_URLS, debug=True)



Reply all
Reply to author
Forward
0 new messages