Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #51459
| From | Terry Reedy <tjreedy@udel.edu> |
|---|---|
| Subject | Re: AssertionError: Headers already set! Status: 500 Internal Server Error Content-Type: text/plain Content-Length: 59 |
| Date | 2013-07-29 12:39 -0400 |
| References | <2cfddec4-58bf-4694-8ac4-de4f4768bc50@googlegroups.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.5242.1375116004.3114.python-list@python.org> (permalink) |
On 7/29/2013 8:55 AM, Jaiky wrote:
> learning web concpt in python
> wrote code in /usr/lib/cgi-bin/hello_world.py
>
> ###########################################################################
> #!/usr/bin/env python
>
> import webapp2
This is an external package.
> form ="""
> <form action="http://www/google.com/search">
> <input name="q">
> <input type="submit">
> </form>"""
>
> class MainPage(webapp2.RequestHandler):
> def get(self):
> self.response.out.write(form)
>
> class TestHandler(webapp2.RequestHandler):
> def get(self):
> q=self.request.get("q")
> self.response.out.write(q)
>
> apps = webapp2.WSGIApplication([('/', MainPage),('/testform',TestHandler)],debug=True)
>
> def main():
> apps.run()
>
> if __name__ == '__main__':
> main()
> ###############################################################################
>
> when running this code on ubuntu 12.04 using command
>
> python hello_world.py
>
> error obtained
>
> AssertionError: Headers already set!
This all comes from webapp2. You should never see assertion error.
Report to authors or ask on webapp2 mailing list if there is one.
> Status: 500 Internal Server Error
> Content-Type: text/plain
> Content-Length: 59
You should have made subject line something like
"Webapp2: AssertionError"
as only someone familiar with webapp2 could give you any help.
--
Terry Jan Reedy
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
AssertionError: Headers already set! Status: 500 Internal Server Error Content-Type: text/plain Content-Length: 59 Jaiky <jaiprakashsingh213@gmail.com> - 2013-07-29 05:55 -0700 Re: AssertionError: Headers already set! Status: 500 Internal Server Error Content-Type: text/plain Content-Length: 59 Terry Reedy <tjreedy@udel.edu> - 2013-07-29 12:39 -0400
csiph-web