summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraodag <aodagx@gmail.com>2016-03-09 00:09:25 +0900
committeraodag <aodagx@gmail.com>2016-03-09 00:09:25 +0900
commitdf1431cb1b62a93e6306725de4b303375c3044ae (patch)
tree549c4a88aab2bb5b9955f0553f7e9099efa9b836
parent8ad1d694650a8901ea7ec3150cdd8f5139b17057 (diff)
downloadpastedeploy-git-fix-17.tar.gz
fix paste_deploy paster template for python3fix-17
-rw-r--r--paste/deploy/paster_templates/paste_deploy/+package+/sampleapp.py_tmpl14
-rw-r--r--paste/deploy/paster_templates/paste_deploy/+package+/wsgiapp.py_tmpl3
2 files changed, 9 insertions, 8 deletions
diff --git a/paste/deploy/paster_templates/paste_deploy/+package+/sampleapp.py_tmpl b/paste/deploy/paster_templates/paste_deploy/+package+/sampleapp.py_tmpl
index cb49352..5514cfc 100644
--- a/paste/deploy/paster_templates/paste_deploy/+package+/sampleapp.py_tmpl
+++ b/paste/deploy/paster_templates/paste_deploy/+package+/sampleapp.py_tmpl
@@ -10,14 +10,14 @@ def application(environ, start_response):
start_response('200 OK', [('Content-type', 'text/html')])
greeting = CONFIG['greeting']
content = [
- '<html><head><title>%s</title></head>\n' % greeting,
- '<body><h1>%s!</h1>\n' % greeting,
- '<table border=1>\n',
+ b'<html><head><title>%s</title></head>\n' % greeting.encode('utf-8'),
+ b'<body><h1>%s!</h1>\n' % greeting.encode('utf-8'),
+ b'<table border=1>\n',
]
items = environ.items()
- items.sort()
+ items = sorted(items)
for key, value in items:
- content.append('<tr><td>%s</td><td>%s</td></tr>\n'
- % (key, cgi.escape(repr(value))))
- content.append('</table></body></html>')
+ content.append(b'<tr><td>%s</td><td>%s</td></tr>\n'
+ % (key.encode('utf-8'), cgi.escape(repr(value)).encode('utf-8')))
+ content.append(b'</table></body></html>')
return content
diff --git a/paste/deploy/paster_templates/paste_deploy/+package+/wsgiapp.py_tmpl b/paste/deploy/paster_templates/paste_deploy/+package+/wsgiapp.py_tmpl
index 97decb8..5684c31 100644
--- a/paste/deploy/paster_templates/paste_deploy/+package+/wsgiapp.py_tmpl
+++ b/paste/deploy/paster_templates/paste_deploy/+package+/wsgiapp.py_tmpl
@@ -1,6 +1,7 @@
+from __future__ import absolute_import
from paste.deploy.config import ConfigMiddleware
-import sampleapp
+from . import sampleapp
def make_app(