Skip to content

Instantly share code, notes, and snippets.

@anandology
Last active June 24, 2016 18:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anandology/72168ffbf33e87ebcfb419d12fd5e7cd to your computer and use it in GitHub Desktop.
Save anandology/72168ffbf33e87ebcfb419d12fd5e7cd to your computer and use it in GitHub Desktop.
Code reproduce a web.py bug caused with Python 3
"""Program to reproduce a bug that appears when used with Python 3.
How to reproduce:
1. Run the dev server
$ python unibug.py
http://0.0.0.0:8080/
2. Open the following URL in your browser.
http://0.0.0.0:8080/
3. See the server crash with UnicodeEncodeError
"""
import web
urls = ("/", "index")
app = web.application(urls, globals())
class index:
def GET(self):
return "\u0C05\u0C06"
if __name__ == "__main__":
app.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment