測試文件報錯
E:\pycharmProject\venv\Scripts\python.exe E:/pycharmProject/hello.py
Traceback (most recent call last):
? File "E:\pycharmProject\venv\lib\site-packages\web\utils.py", line 526, in take
? ? yield next(seq)
StopIteration
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
? File "E:/pycharmProject/hello.py", line 6, in <module>
? ? app = web.application(urls, globals())
? File "E:\pycharmProject\venv\lib\site-packages\web\application.py", line 62, in __init__
? ? self.init_mapping(mapping)
? File "E:\pycharmProject\venv\lib\site-packages\web\application.py", line 130, in init_mapping
? ? self.mapping = list(utils.group(mapping, 2))
? File "E:\pycharmProject\venv\lib\site-packages\web\utils.py", line 531, in group
? ? x = list(take(seq, size))
RuntimeError: generator raised StopIteration
2019-04-16
2019-03-01
錯誤原因,python3以上安裝執(zhí)行應(yīng)pip install web.py==0.40-dev1,還要修改utils文件的526行
to:
做這個之前,請先卸載之前的安裝pip uninstall web.py
2018-09-30
To judge from the file paths, it looks like you're running Python 3.7. If so, you're getting caught by new-in-3.7 behavior?described here:
Before this change, a?
StopIteration
?raised by, or passing through, a generator simply ended the generator's useful life (the exception was silently swallowed). The module you're using will have to be recoded to work as intended with 3.7.Chances are they'll need to change:
to: