简体   繁体   English

Bottle.py未重新加载

[英]Bottle.py not reloading

So... trying to follow along the Bottle To-Do list tutorial , using WinPython 3.4.3 . 所以...尝试使用WinPython 3.4.3继续执行Bottle To-Do列表教程 Basically, I was having fits with the script not reloading, despite having 基本上,尽管有

run(host='localhost', port=8080, reloader=True, debug=True)

set at the end of the file. 在文件末尾设置。 After trying the same tutorial @ home with no problems (using Linux), I figured the problem had to be somewhere in the form of Python that I'm using. 在没有问题的情况下尝试使用@home相同的教程(使用Linux)之后,我发现问题一定是我正在使用的Python形式的某个地方。 I was using Spyder, but reverted to running the script directly from the command line, and noticed that it appears to not be exiting cleanly when it reloads and/or when the script is stopped, as I'm getting an error like this: 我使用的是Spyder,但恢复为直接从命令行运行脚本,并且注意到它在重新加载和/或停止脚本时似乎没有干净退出,因为我遇到了这样的错误:

E:\python\data\bottle-todo>E:\python\WinPython-32bit-3.4.3.2\python-3.4.3\lib\site-packages\bottle.py:3113: ResourceWarning: unclosed <socket.socket fd=268, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 8080)> server.run(app)

I can get things working if I look up and kill any running python processes, and then remove the reloader=True argument to run() ... but that seems like fixing the symptom, not the problem. 如果我查找并杀死任何正在运行的python进程,然后将reloader=True参数删除到run() ,就可以使事情工作,但是这似乎是在解决症状,而不是问题。 FWIW, I still get the same error message when I terminate the running script with CTRL+C , but it seems to actually terminate - unlike with the reloader. FWIW,当我使用CTRL+C终止正在运行的脚本时,我仍然收到相同的错误消息,但是它似乎实际上已经终止了-与重新加载器不同。

Question is... is this a bottle.py problem with the reloader under python3.4 + windows, or WinPython, or something else? 问题是...这是python3.4 + Windows,WinPython或其他版本下的reloader的bottle.py问题吗?

some processes launched via "spyder 2.3.4 version in Winpython" in a separate process don't want to die when they should. 通过“ Winpython中的spyder 2.3.4版本”在单独的进程中启动的某些进程不希望在适当的时候死掉。

I'm really not sure where is the problem, but your issue looks a little bit like mine, so: 我真的不确定问题出在哪里,但是您的问题看起来有点像我的问题,因此:

  • bottle and Windows seem not the guilty parties. 瓶子和窗户似乎不是有罪的聚会。

  • spyder 2.3.5 or recent Winpython or other recent package may be at fault. spyder 2.3.5或最新的Winpython或其他最新的软件包可能出错。

I think my issue didn't exist under Winpython3.4.3.1. 我认为我的问题在Winpython3.4.3.1下不存在。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM