bottle
bottle copied to clipboard
socketserver.py error when using with paste
hello, bravo for bottlepy, it's really understandable for my students.
i try to use it with paste, but socketserver.py handled type error when i use template values :
TypeError: a bytes-like object is required, not 'str'
the entire error
Traceback (most recent call last):
----------------------------------------
File "/usr/lib/python3/dist-packages/paste/httpserver.py", line 1085, in process_request_in_thread
self.finish_request(request, client_address)
Exception happened during processing of request from ('127.0.0.1', 49242)
File "/usr/lib/python3.6/socketserver.py", line 364, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.6/socketserver.py", line 724, in __init__
self.handle()
File "/usr/lib/python3/dist-packages/paste/httpserver.py", line 459, in handle
BaseHTTPRequestHandler.handle(self)
Traceback (most recent call last):
File "/usr/lib/python3.6/http/server.py", line 418, in handle
self.handle_one_request()
File "/usr/lib/python3/dist-packages/paste/httpserver.py", line 1085, in process_request_in_thread
self.finish_request(request, client_address)
File "/usr/lib/python3/dist-packages/paste/httpserver.py", line 454, in handle_one_request
self.wsgi_execute()
File "/usr/lib/python3.6/socketserver.py", line 364, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3/dist-packages/paste/httpserver.py", line 309, in wsgi_execute
self.wsgi_write_chunk('')
File "/usr/lib/python3.6/socketserver.py", line 724, in __init__
self.handle()
File "/usr/lib/python3/dist-packages/paste/httpserver.py", line 167, in wsgi_write_chunk
self.wfile.write(chunk)
File "/usr/lib/python3/dist-packages/paste/httpserver.py", line 459, in handle
BaseHTTPRequestHandler.handle(self)
File "/usr/lib/python3.6/http/server.py", line 418, in handle
self.handle_one_request()
File "/usr/lib/python3.6/socketserver.py", line 803, in write
self._sock.sendall(b)
File "/usr/lib/python3/dist-packages/paste/httpserver.py", line 454, in handle_one_request
self.wsgi_execute()
TypeError: a bytes-like object is required, not 'str'
File "/usr/lib/python3/dist-packages/paste/httpserver.py", line 309, in wsgi_execute
self.wsgi_write_chunk('')
----------------------------------------
File "/usr/lib/python3/dist-packages/paste/httpserver.py", line 167, in wsgi_write_chunk
self.wfile.write(chunk)
File "/usr/lib/python3.6/socketserver.py", line 803, in write
self._sock.sendall(b)
TypeError: a bytes-like object is required, not 'str' ```