简体   繁体   中英

Bottle.py not reloading

So... trying to follow along the Bottle To-Do list tutorial , using WinPython 3.4.3 . 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. 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:

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. 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.

Question is... is this a bottle.py problem with the reloader under python3.4 + windows, or WinPython, or something else?

some processes launched via "spyder 2.3.4 version in Winpython" in a separate process don't want to die when they should.

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.

I think my issue didn't exist under Winpython3.4.3.1.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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