Tutorial :Why can I not view my Google App Engine cron admin page?



Question:

When I go to http://localhost:8080/_ah/admin/cron, as stated in Google's docs, I get the following:

Traceback (most recent call last):  File "C:\Program Files\Google\google_appengine\google\appengine\ext\webapp\__init__.py", line 501, in __call__  handler.get(*groups)  File "C:\Program Files\Google\google_appengine\google\appengine\ext\admin\__init__.py", line 239, in get  schedule = groctimespecification.GrocTimeSpecification(entry.schedule)  File "C:\Program Files\Google\google_appengine\google\appengine\cron\groctimespecification.py", line 71, in GrocTimeSpecification  parser.period_string)  File "C:\Program Files\Google\google_appengine\google\appengine\cron\groctimespecification.py", line 122, in __init__  super(IntervalTimeSpecification, self).__init__(self)  TypeError: object.__init__() takes no parameters  

I have the latest SDK, and it looks like my config files are correct.


Solution:1

This is definitely a bug in Google App Engine. If you check groctimespecification.py, you'll see that IntervalTimeSpecification inherits from TimeSpecification, which in turn inherits directly from object and doesn't override its __init__ method.

So the __init__ of IntervalTimeSpecification is incorrect:

class IntervalTimeSpecification(TimeSpecification):    def __init__(self, interval, period):      super(IntervalTimeSpecification, self).__init__(self)  

My guess is, someone converted an old-style parent class init call:

TimeSpecification.__init__(self)  

to the current one, but forgot that with super, self is passed implicitly. The correct line should look like this:

super(IntervalTimeSpecification, self).__init__()  


Solution:2

Congratulations! You've found a bug. Can you file a bug on the public issue tracker, please? If you want to fix it for yourself immediately, delete the 'self' argument in the line referenced at the end of that stacktrace.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »