Skip to content

Instantly share code, notes, and snippets.

@maiamcc
Last active March 6, 2020 23:19
Show Gist options
  • Select an option

  • Save maiamcc/8081319294438e6bc85c3d7868f914ed to your computer and use it in GitHub Desktop.

Select an option

Save maiamcc/8081319294438e6bc85c3d7868f914ed to your computer and use it in GitHub Desktop.
import time
from flask import Flask
app = Flask(__name__)
@app.route("/")
def serve():
now = time.asctime(time.localtime(time.time()))
import web_pdb; web_pdb.set_trace()
return "the time is now: {}\n".format(now)
if __name__ == "__main__":
app.run(debug=True)

Repro instructions for python-web-pdb#18:

  1. pip install flask web-pdb
  2. python sample.py
  3. curl http://127.0.0.1:5000/ (will trip the debugger; request will hang)
  4. navigate to localhost:5555 in browser, type "c" to continue. See curl from step #3 complete
  5. curl http://127.0.0.1:5000/ (will trip the debugger)

Expected behavior: the curl of step #5 will hang, and navigating to localhost:5555 will bring you to a live debugger (as in steps #3 & #4 previously).

Observed behavior: the curl of step #5 completes immediately, does not trip the debugger.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment