问题1:
Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/web/utils.py", line 527, in take
yield next(seq)
StopIteration
解决方案:
编辑文件:
vim /usr/lib/python3.7/site-packages/web/utils.py 第525行
修改如下:
524 def take(seq, n):
525 for i in range(n):
526 try:
527 yield next(seq)
528 except StopIteration:
529 return
问题2:
WEBPY / Serving static files : 'StaticApp Object has no attribute 'directory'
解决方案:
编辑文件:
vim /usr/lib/python3.7/site-packages/web/httpserver.py
添加代码,在230行之下添加 :
self.directory = os.getcwd()
代码如下:
225 class StaticApp(SimpleHTTPRequestHandler):
226 """WSGI application for serving static files."""
227 def __init__(self, environ, start_response):
228 self.headers = []
229 self.environ = environ
230 self.start_response = start_response
231 self.directory = os.getcwd()