遇到奇怪的问题: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下载地 ...
随机推荐
- 【LeetCode】1409. 查询带键的排列 Queries on a Permutation With Key
作者: 负雪明烛 id: fuxuemingzhu 个人博客:http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 模拟 日期 题目地址:https://leetcode ...
- 【LeetCode】1037. Valid Boomerang 解题报告(C++)
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 中学数学题 日期 题目地址:https://leet ...
- 【剑指Offer】求1+2+3+...+n 解题报告(C++)
[剑指Offer]求1+2+3+-+n 解题报告(C++) 标签(空格分隔): 剑指Offer 题目地址:https://www.nowcoder.com/ta/coding-interviews 题 ...
- 1076 - Get the Containers
1076 - Get the Containers PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 ...
- DEV GridControl小结。。
[转]DEV GridControl小结.. 来自:http://www.cnblogs.com/yuerdongni/archive/2012/09/08/2676753.html 1. 如何解 ...
- 【Java例题】4.2 级数求和2
2. 计算级数之和: y=1/1!*x-1/3!*x^3+1/5!*x^5+...+ (-1)^n/(2n+1)!*x^(2n+1). 这里的"^"表示乘方,"!&quo ...
- 美和易思 - JAVA开发&移动互联网 阶段性教学效果检测考试机试试题【题目:维护洗衣店消费项数据】
一. 语言和环境 1. 实现语言:Java 语言. 2. 环境要求:Eclipse 或 Myeclipse+MySQL. 二. 功能需求 利用 Java Swing 和 JDBC 技术维护洗衣店消费项 ...
- Mybatis获取自增主键的值
pojo: public class User { private Integer id; private String name; private String pwd; setter和getter ...
- eDiary电子日记本
1.简介 eDiary是一款小巧的本地电子日记本, 也可以用来管理资料文档, 支持常用的文字编辑排版功能, 也支持插入图片功能. 支持多用户,可以设置登录用户名和密码, 每个用户可拥有多个日记文件, ...
- C#中的显式转换
大多数编程语言都支持显示转换,也称为强制转换,它与隐式转换相呼应,比如,一般的,整型可以通过隐式转换成浮点型,而浮点型需要通过强制转换成整型: int i = 32; double d = i;//整 ...