遇到奇怪的问题:web.py 0.40中使用web.input(),出现一堆奇怪的错误
有的请求很正常,有的请求就出现了500错误。
这里使用POST请求,然后在web.input()中出现了很长很长的错误。
猜测是这个机器上安装了python2.7 / python 3.6 / python3.7, 可能是版本太多导致某个点出错。
暂时想不到该如何解决……
=============================
16:53补充:
这里提到了这个问题,但是替换cgi.py这个文件并未解决问题
https://github.com/webpy/webpy/issues/574
具体的错误信息如下:
Traceback (most recent call last):
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 289, in process
return self.handle()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 280, in handle
return self._delegate(fn, self.fvars, args)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 530, in _delegate
return handle_class(cls)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 508, in handle_class
return tocall(*args)
File "../public_module/schema_base.py", line 155, in POST
return self._execute(True)
File "../public_module/schema_base.py", line 34, in _execute
param = web.input()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 468, in input
out = rawinput(_method)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 444, in rawinput
a = cgi.FieldStorage(fp=fp, environ=e, keep_blank_values=1)
File "/usr/lib64/python3.6/cgi.py", line 566, in __init__
self.read_single()
File "/usr/lib64/python3.6/cgi.py", line 757, in read_single
self.read_binary()
File "/usr/lib64/python3.6/cgi.py", line 779, in read_binary
self.file.write(data)
TypeError: write() argument must be str, not bytes
Traceback (most recent call last):
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 289, in process
return self.handle()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 280, in handle
return self._delegate(fn, self.fvars, args)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 530, in _delegate
return handle_class(cls)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 508, in handle_class
return tocall(*args)
File "../public_module/schema_base.py", line 155, in POST
return self._execute(True)
File "../public_module/schema_base.py", line 34, in _execute
param = web.input()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 468, in input
out = rawinput(_method)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 444, in rawinput
a = cgi.FieldStorage(fp=fp, environ=e, keep_blank_values=1)
File "/usr/lib64/python3.6/cgi.py", line 566, in __init__
self.read_single()
File "/usr/lib64/python3.6/cgi.py", line 757, in read_single
self.read_binary()
File "/usr/lib64/python3.6/cgi.py", line 779, in read_binary
self.file.write(data)
TypeError: write() argument must be str, not bytes
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 287, in process
return p(lambda: process(processors))
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 699, in processor
return handler()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 287, in <lambda>
return p(lambda: process(processors))
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 296, in process
raise self.internalerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 587, in internalerror
return debugerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 333, in debugerror
return web._InternalError(djangoerror())
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 322, in djangoerror
return t(exception_type, exception_value, frames)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 986, in __call__
return BaseTemplate.__call__(self, *a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 897, in __call__
return self.t(*a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 193, in __template__
</ol>
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 468, in input
out = rawinput(_method)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 444, in rawinput
a = cgi.FieldStorage(fp=fp, environ=e, keep_blank_values=1)
File "/usr/lib64/python3.6/cgi.py", line 566, in __init__
self.read_single()
File "/usr/lib64/python3.6/cgi.py", line 757, in read_single
self.read_binary()
File "/usr/lib64/python3.6/cgi.py", line 779, in read_binary
self.file.write(data)
TypeError: write() argument must be str, not bytes
Traceback (most recent call last):
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 289, in process
return self.handle()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 280, in handle
return self._delegate(fn, self.fvars, args)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 530, in _delegate
return handle_class(cls)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 508, in handle_class
return tocall(*args)
File "../public_module/schema_base.py", line 155, in POST
return self._execute(True)
File "../public_module/schema_base.py", line 34, in _execute
param = web.input()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 468, in input
out = rawinput(_method)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 444, in rawinput
a = cgi.FieldStorage(fp=fp, environ=e, keep_blank_values=1)
File "/usr/lib64/python3.6/cgi.py", line 566, in __init__
self.read_single()
File "/usr/lib64/python3.6/cgi.py", line 757, in read_single
self.read_binary()
File "/usr/lib64/python3.6/cgi.py", line 779, in read_binary
self.file.write(data)
TypeError: write() argument must be str, not bytes
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 287, in process
return p(lambda: process(processors))
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 699, in processor
return handler()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 287, in <lambda>
return p(lambda: process(processors))
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 296, in process
raise self.internalerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 587, in internalerror
return debugerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 333, in debugerror
return web._InternalError(djangoerror())
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 322, in djangoerror
return t(exception_type, exception_value, frames)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 986, in __call__
return BaseTemplate.__call__(self, *a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 897, in __call__
return self.t(*a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 193, in __template__
</ol>
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 468, in input
out = rawinput(_method)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 444, in rawinput
a = cgi.FieldStorage(fp=fp, environ=e, keep_blank_values=1)
File "/usr/lib64/python3.6/cgi.py", line 566, in __init__
self.read_single()
File "/usr/lib64/python3.6/cgi.py", line 757, in read_single
self.read_binary()
File "/usr/lib64/python3.6/cgi.py", line 779, in read_binary
self.file.write(data)
TypeError: write() argument must be str, not bytes
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 287, in process
return p(lambda: process(processors))
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 699, in processor
return handler()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 287, in <lambda>
return p(lambda: process(processors))
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 296, in process
raise self.internalerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 587, in internalerror
return debugerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 333, in debugerror
return web._InternalError(djangoerror())
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 322, in djangoerror
return t(exception_type, exception_value, frames)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 986, in __call__
return BaseTemplate.__call__(self, *a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 897, in __call__
return self.t(*a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 193, in __template__
</ol>
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 468, in input
out = rawinput(_method)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 444, in rawinput
a = cgi.FieldStorage(fp=fp, environ=e, keep_blank_values=1)
File "/usr/lib64/python3.6/cgi.py", line 566, in __init__
self.read_single()
File "/usr/lib64/python3.6/cgi.py", line 757, in read_single
self.read_binary()
File "/usr/lib64/python3.6/cgi.py", line 779, in read_binary
self.file.write(data)
TypeError: write() argument must be str, not bytes
Traceback (most recent call last):
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 289, in process
return self.handle()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 280, in handle
return self._delegate(fn, self.fvars, args)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 530, in _delegate
return handle_class(cls)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 508, in handle_class
return tocall(*args)
File "../public_module/schema_base.py", line 155, in POST
return self._execute(True)
File "../public_module/schema_base.py", line 34, in _execute
param = web.input()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 468, in input
out = rawinput(_method)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 444, in rawinput
a = cgi.FieldStorage(fp=fp, environ=e, keep_blank_values=1)
File "/usr/lib64/python3.6/cgi.py", line 566, in __init__
self.read_single()
File "/usr/lib64/python3.6/cgi.py", line 757, in read_single
self.read_binary()
File "/usr/lib64/python3.6/cgi.py", line 779, in read_binary
self.file.write(data)
TypeError: write() argument must be str, not bytes
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 287, in process
return p(lambda: process(processors))
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 699, in processor
return handler()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 287, in <lambda>
return p(lambda: process(processors))
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 296, in process
raise self.internalerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 587, in internalerror
return debugerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 333, in debugerror
return web._InternalError(djangoerror())
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 322, in djangoerror
return t(exception_type, exception_value, frames)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 986, in __call__
return BaseTemplate.__call__(self, *a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 897, in __call__
return self.t(*a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 193, in __template__
</ol>
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 468, in input
out = rawinput(_method)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 444, in rawinput
a = cgi.FieldStorage(fp=fp, environ=e, keep_blank_values=1)
File "/usr/lib64/python3.6/cgi.py", line 566, in __init__
self.read_single()
File "/usr/lib64/python3.6/cgi.py", line 757, in read_single
self.read_binary()
File "/usr/lib64/python3.6/cgi.py", line 779, in read_binary
self.file.write(data)
TypeError: write() argument must be str, not bytes
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 287, in process
return p(lambda: process(processors))
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 699, in processor
return handler()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 287, in <lambda>
return p(lambda: process(processors))
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 296, in process
raise self.internalerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 587, in internalerror
return debugerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 333, in debugerror
return web._InternalError(djangoerror())
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 322, in djangoerror
return t(exception_type, exception_value, frames)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 986, in __call__
return BaseTemplate.__call__(self, *a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 897, in __call__
return self.t(*a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 193, in __template__
</ol>
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 468, in input
out = rawinput(_method)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 444, in rawinput
a = cgi.FieldStorage(fp=fp, environ=e, keep_blank_values=1)
File "/usr/lib64/python3.6/cgi.py", line 566, in __init__
self.read_single()
File "/usr/lib64/python3.6/cgi.py", line 757, in read_single
self.read_binary()
File "/usr/lib64/python3.6/cgi.py", line 779, in read_binary
self.file.write(data)
TypeError: write() argument must be str, not bytes
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 287, in process
return p(lambda: process(processors))
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 716, in processor
result = handler()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 287, in <lambda>
return p(lambda: process(processors))
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 296, in process
raise self.internalerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 587, in internalerror
return debugerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 333, in debugerror
return web._InternalError(djangoerror())
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 322, in djangoerror
return t(exception_type, exception_value, frames)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 986, in __call__
return BaseTemplate.__call__(self, *a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 897, in __call__
return self.t(*a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 193, in __template__
</ol>
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 468, in input
out = rawinput(_method)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 444, in rawinput
a = cgi.FieldStorage(fp=fp, environ=e, keep_blank_values=1)
File "/usr/lib64/python3.6/cgi.py", line 566, in __init__
self.read_single()
File "/usr/lib64/python3.6/cgi.py", line 757, in read_single
self.read_binary()
File "/usr/lib64/python3.6/cgi.py", line 779, in read_binary
self.file.write(data)
TypeError: write() argument must be str, not bytes
Traceback (most recent call last):
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 289, in process
return self.handle()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 280, in handle
return self._delegate(fn, self.fvars, args)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 530, in _delegate
return handle_class(cls)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 508, in handle_class
return tocall(*args)
File "../public_module/schema_base.py", line 155, in POST
return self._execute(True)
File "../public_module/schema_base.py", line 34, in _execute
param = web.input()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 468, in input
out = rawinput(_method)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 444, in rawinput
a = cgi.FieldStorage(fp=fp, environ=e, keep_blank_values=1)
File "/usr/lib64/python3.6/cgi.py", line 566, in __init__
self.read_single()
File "/usr/lib64/python3.6/cgi.py", line 757, in read_single
self.read_binary()
File "/usr/lib64/python3.6/cgi.py", line 779, in read_binary
self.file.write(data)
TypeError: write() argument must be str, not bytes
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 287, in process
return p(lambda: process(processors))
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 699, in processor
return handler()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 287, in <lambda>
return p(lambda: process(processors))
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 296, in process
raise self.internalerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 587, in internalerror
return debugerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 333, in debugerror
return web._InternalError(djangoerror())
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 322, in djangoerror
return t(exception_type, exception_value, frames)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 986, in __call__
return BaseTemplate.__call__(self, *a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 897, in __call__
return self.t(*a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 193, in __template__
</ol>
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 468, in input
out = rawinput(_method)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 444, in rawinput
a = cgi.FieldStorage(fp=fp, environ=e, keep_blank_values=1)
File "/usr/lib64/python3.6/cgi.py", line 566, in __init__
self.read_single()
File "/usr/lib64/python3.6/cgi.py", line 757, in read_single
self.read_binary()
File "/usr/lib64/python3.6/cgi.py", line 779, in read_binary
self.file.write(data)
TypeError: write() argument must be str, not bytes
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 287, in process
return p(lambda: process(processors))
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 699, in processor
return handler()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 287, in <lambda>
return p(lambda: process(processors))
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 296, in process
raise self.internalerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 587, in internalerror
return debugerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 333, in debugerror
return web._InternalError(djangoerror())
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 322, in djangoerror
return t(exception_type, exception_value, frames)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 986, in __call__
return BaseTemplate.__call__(self, *a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 897, in __call__
return self.t(*a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 193, in __template__
</ol>
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 468, in input
out = rawinput(_method)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 444, in rawinput
a = cgi.FieldStorage(fp=fp, environ=e, keep_blank_values=1)
File "/usr/lib64/python3.6/cgi.py", line 566, in __init__
self.read_single()
File "/usr/lib64/python3.6/cgi.py", line 757, in read_single
self.read_binary()
File "/usr/lib64/python3.6/cgi.py", line 779, in read_binary
self.file.write(data)
TypeError: write() argument must be str, not bytes
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 287, in process
return p(lambda: process(processors))
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 716, in processor
result = handler()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 287, in <lambda>
return p(lambda: process(processors))
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 296, in process
raise self.internalerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 587, in internalerror
return debugerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 333, in debugerror
return web._InternalError(djangoerror())
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 322, in djangoerror
return t(exception_type, exception_value, frames)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 986, in __call__
return BaseTemplate.__call__(self, *a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 897, in __call__
return self.t(*a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 193, in __template__
</ol>
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 468, in input
out = rawinput(_method)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 444, in rawinput
a = cgi.FieldStorage(fp=fp, environ=e, keep_blank_values=1)
File "/usr/lib64/python3.6/cgi.py", line 566, in __init__
self.read_single()
File "/usr/lib64/python3.6/cgi.py", line 757, in read_single
self.read_binary()
File "/usr/lib64/python3.6/cgi.py", line 779, in read_binary
self.file.write(data)
TypeError: write() argument must be str, not bytes
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 287, in process
return p(lambda: process(processors))
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 699, in processor
return handler()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 287, in <lambda>
return p(lambda: process(processors))
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 296, in process
raise self.internalerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 587, in internalerror
return debugerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 333, in debugerror
return web._InternalError(djangoerror())
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 322, in djangoerror
return t(exception_type, exception_value, frames)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 986, in __call__
return BaseTemplate.__call__(self, *a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 897, in __call__
return self.t(*a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 193, in __template__
</ol>
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 468, in input
out = rawinput(_method)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 444, in rawinput
a = cgi.FieldStorage(fp=fp, environ=e, keep_blank_values=1)
File "/usr/lib64/python3.6/cgi.py", line 566, in __init__
self.read_single()
File "/usr/lib64/python3.6/cgi.py", line 757, in read_single
self.read_binary()
File "/usr/lib64/python3.6/cgi.py", line 779, in read_binary
self.file.write(data)
TypeError: write() argument must be str, not bytes
TypeError('write() argument must be str, not bytes',)
Traceback (most recent call last):
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 289, in process
return self.handle()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 280, in handle
return self._delegate(fn, self.fvars, args)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 530, in _delegate
return handle_class(cls)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 508, in handle_class
return tocall(*args)
File "../public_module/schema_base.py", line 155, in POST
return self._execute(True)
File "../public_module/schema_base.py", line 34, in _execute
param = web.input()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 468, in input
out = rawinput(_method)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 444, in rawinput
a = cgi.FieldStorage(fp=fp, environ=e, keep_blank_values=1)
File "/usr/lib64/python3.6/cgi.py", line 566, in __init__
self.read_single()
File "/usr/lib64/python3.6/cgi.py", line 757, in read_single
self.read_binary()
File "/usr/lib64/python3.6/cgi.py", line 779, in read_binary
self.file.write(data)
TypeError: write() argument must be str, not bytes
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 287, in process
return p(lambda: process(processors))
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 699, in processor
return handler()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 287, in <lambda>
return p(lambda: process(processors))
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 296, in process
raise self.internalerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 587, in internalerror
return debugerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 333, in debugerror
return web._InternalError(djangoerror())
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 322, in djangoerror
return t(exception_type, exception_value, frames)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 986, in __call__
return BaseTemplate.__call__(self, *a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 897, in __call__
return self.t(*a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 193, in __template__
</ol>
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 468, in input
out = rawinput(_method)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 444, in rawinput
a = cgi.FieldStorage(fp=fp, environ=e, keep_blank_values=1)
File "/usr/lib64/python3.6/cgi.py", line 566, in __init__
self.read_single()
File "/usr/lib64/python3.6/cgi.py", line 757, in read_single
self.read_binary()
File "/usr/lib64/python3.6/cgi.py", line 779, in read_binary
self.file.write(data)
TypeError: write() argument must be str, not bytes
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 287, in process
return p(lambda: process(processors))
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 699, in processor
return handler()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 287, in <lambda>
return p(lambda: process(processors))
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 296, in process
raise self.internalerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 587, in internalerror
return debugerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 333, in debugerror
return web._InternalError(djangoerror())
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 322, in djangoerror
return t(exception_type, exception_value, frames)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 986, in __call__
return BaseTemplate.__call__(self, *a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 897, in __call__
return self.t(*a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 193, in __template__
</ol>
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 468, in input
out = rawinput(_method)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 444, in rawinput
a = cgi.FieldStorage(fp=fp, environ=e, keep_blank_values=1)
File "/usr/lib64/python3.6/cgi.py", line 566, in __init__
self.read_single()
File "/usr/lib64/python3.6/cgi.py", line 757, in read_single
self.read_binary()
File "/usr/lib64/python3.6/cgi.py", line 779, in read_binary
self.file.write(data)
TypeError: write() argument must be str, not bytes
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 287, in process
return p(lambda: process(processors))
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 716, in processor
result = handler()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 287, in <lambda>
return p(lambda: process(processors))
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 296, in process
raise self.internalerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 587, in internalerror
return debugerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 333, in debugerror
return web._InternalError(djangoerror())
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 322, in djangoerror
return t(exception_type, exception_value, frames)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 986, in __call__
return BaseTemplate.__call__(self, *a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 897, in __call__
return self.t(*a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 193, in __template__
</ol>
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 468, in input
out = rawinput(_method)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 444, in rawinput
a = cgi.FieldStorage(fp=fp, environ=e, keep_blank_values=1)
File "/usr/lib64/python3.6/cgi.py", line 566, in __init__
self.read_single()
File "/usr/lib64/python3.6/cgi.py", line 757, in read_single
self.read_binary()
File "/usr/lib64/python3.6/cgi.py", line 779, in read_binary
self.file.write(data)
TypeError: write() argument must be str, not bytes
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 287, in process
return p(lambda: process(processors))
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 699, in processor
return handler()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 287, in <lambda>
return p(lambda: process(processors))
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 296, in process
raise self.internalerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 587, in internalerror
return debugerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 333, in debugerror
return web._InternalError(djangoerror())
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 322, in djangoerror
return t(exception_type, exception_value, frames)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 986, in __call__
return BaseTemplate.__call__(self, *a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 897, in __call__
return self.t(*a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 193, in __template__
</ol>
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 468, in input
out = rawinput(_method)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 444, in rawinput
a = cgi.FieldStorage(fp=fp, environ=e, keep_blank_values=1)
File "/usr/lib64/python3.6/cgi.py", line 566, in __init__
self.read_single()
File "/usr/lib64/python3.6/cgi.py", line 757, in read_single
self.read_binary()
File "/usr/lib64/python3.6/cgi.py", line 779, in read_binary
self.file.write(data)
TypeError: write() argument must be str, not bytes
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/cheroot-8.2.1-py3.6.egg/cheroot/server.py", line 1280, in communicate
req.respond()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/cheroot-8.2.1-py3.6.egg/cheroot/server.py", line 1083, in respond
self.server.gateway(self).respond()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/cheroot-8.2.1-py3.6.egg/cheroot/wsgi.py", line 143, in respond
response = self.req.server.wsgi_app(self.env, self.start_response)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/httpserver.py", line 306, in __call__
return self.app(environ, xstart_response)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/httpserver.py", line 273, in __call__
return self.app(environ, start_response)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 328, in wsgi
result = self.handle_with_processors()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 299, in handle_with_processors
return process(self.processors)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 296, in process
raise self.internalerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/application.py", line 587, in internalerror
return debugerror()
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 333, in debugerror
return web._InternalError(djangoerror())
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 322, in djangoerror
return t(exception_type, exception_value, frames)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 986, in __call__
return BaseTemplate.__call__(self, *a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/template.py", line 897, in __call__
return self.t(*a, **kw)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/debugerror.py", line 193, in __template__
</ol>
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 468, in input
out = rawinput(_method)
File "/data/home/ahfuzhang/.local/lib/python3.6/site-packages/web/webapi.py", line 444, in rawinput
a = cgi.FieldStorage(fp=fp, environ=e, keep_blank_values=1)
File "/usr/lib64/python3.6/cgi.py", line 566, in __init__
self.read_single()
File "/usr/lib64/python3.6/cgi.py", line 757, in read_single
self.read_binary()
File "/usr/lib64/python3.6/cgi.py", line 779, in read_binary
self.file.write(data)
TypeError: write() argument must be str, not bytes
遇到奇怪的问题:web.py 0.40中使用web.input(),出现一堆奇怪的错误的更多相关文章
- 返璞归真 asp.net mvc (11) - asp.net mvc 4.0 新特性之自宿主 Web API, 在 WebForm 中提供 Web API, 通过 Web API 上传文件, .net 4.5 带来的更方便的异步操作
原文:返璞归真 asp.net mvc (11) - asp.net mvc 4.0 新特性之自宿主 Web API, 在 WebForm 中提供 Web API, 通过 Web API 上传文件, ...
- web.py 学习(-)Rocket web框架
Rocket是一个轻量级,多线程,符合WSGI规范的web框架. Rocket使用一个线程监听连接,接收到连接之后放到Queue中,有worker线程进行处理. Rocket含有以下属性: metho ...
- web.py网页模板中使用jquery
由于$是web.py针对模板的保留字符,所以在模板文件内不能直接使用$("#id")的格式. 解决办法: 1.$$("#id")可以避免$被误解析 2.jque ...
- Tomcat翻译--Tomcat Web Application Deployment(Tomcat中部署web应用)
原文:http://tomcat.apache.org/tomcat-7.0-doc/deployer-howto.html Introduction(介绍) Deployment is the te ...
- tomcat下的web.xml和项目中的web.xml
Tomcat 服务器中存在一个web.xml文件 在项目文件夹中同样存在一个web.xml文件 那这两个文件有什么区别呢? tomcat中的web.xml是通用的,如果不设置,那么就会默认是同tomc ...
- Windows下安装Web.py快速指南
环境介绍 首先介绍下安装使用的环境 - Windows 7 - Python 3.6 Web.py介绍 web.py是Python在Web领域一个轻量级的解决方案,所谓轻量,就是非常简单快速满足Web ...
- python3.X 安装web.py 失败的解决方法
python2.x 安装python是非常顺利的 但是 在进行 pip3 install web.py 时提示很多错误 例如缺少模块 语法错误...... 最后试了一下web.py 的dev版本 pi ...
- python3使用web.py遇到的找不属性的错误解决
今天用pyhon安装完web.py的时候,点击运行还是没错的,但是在网页输入链接就会报错.1.安装我是这样的: pip install web.py 2.运行后错误信息是这样: AttributeEr ...
- Windows下Nginx+Web.py+FastCGI服务搭建
在搭建之前,有必要了解下什么是fastcgi,但鉴于我自己也不大了解,这里就不搬门弄斧了,请参考各种百科和官网资料. 1.资源下载 python下载地址:戳这里webpy下载地址:戳这里flup下载地 ...
随机推荐
- CF177A1/A2 Good Matrix Elements 题解
Content 给定一个 \(n\times n\) 的矩阵,每个元素都有一个值,求出处于两条对角线以及中间行和中间列的元素之和. 数据范围:\(1\leqslant n\leqslant 5(\te ...
- Tornado.web.Application之-settings
应用程序配置 class tornado.web.Application(handlers:List [Union [Rule,Tuple]] = None,default_host:str = N ...
- XMLHttpRequest() 如何预检查CORS跨域请求的?
https://blog.csdn.net/qq_38261174/article/details/90691058
- 使用PostMan测试WebService接口教程
一.操作步骤 1.设置URL 2.设置请求模式:Post 3.设置Header:添加 Content-Type ,值为 text/xml;charset=utf-8 4.设置Body:勾选raw 5. ...
- Miniconda入门教程
Miniconda 教程 介绍 Anaconda指的是一个开源的Python发行版本,其包含了conda.Python等180多个科学包及其依赖项.因为包含了大量的科学包,Anaconda 的下载文件 ...
- codeforce 597C-Subsequences(dp+树状数组)
题目和南阳那道题一样链接http://www.cnblogs.com/zzuli2sjy/p/4943774.html 代码: 1 #include<stdio.h> 2 #include ...
- idea使用教程-idea简介
集成开发环境(IDE,Integrated Development Environment )是用于提供程序开发环境的应用程序,一般包括代码编辑器.编译器.调试器和图形用户界面等工具.集成了代码编写功 ...
- Generative Adversarial Nets (GAN)
目录 目标 框架 理论 数值实验 代码 Generative Adversarial Nets 这篇文章,引领了对抗学习的思想,更加可贵的是其中的理论证明,证明很少却直击要害. 目标 GAN,译名生成 ...
- [C++]使用vector描述线性表定义及基本操作
#ifndef VECTORLIST_H #define VECTORLIST_H #include<iostream> #include"linearlist.h" ...
- [opencv]图像预处理方案及方式
像识别中,图像质量的好坏直接影响识别算法的设计与效果精度,那么除了能在算法上的优化外,预处理技术在整个项目中占有很重要的因素,然而人们往往忽略这一点. 图像预处理,将每一个文字图像分检出来交给识别模块 ...