Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
werkzeug: patch reloader to find nix wrapped python scripts #33094
Motivation for this change
Currently, the werkzeug will crash if the entrypoint is wrapped by Nix (for example;
This commit adds a patch to fix this. This patch is quite Nix specific; and therefore would not make sense to upstream.
An alternate way to fix this would be to stop Nix from changing the
How to test
This can be tested using Flask.
Create a script
from flask import Flask app = Flask(__name__) @app.route('/') def index(): return 'Hello World'
Then run it using Flask:
When using the old version; this will crash during startup (as descried in #33093).
When using the patch; this will run and not crash. The reloader will as intended.
Actually, because the script is being given a shebang, it should not be run anymore like
Well; I'm not sure that Werkzeug is in the wrong here.
Other than reassigning the value in python, I'm not sure it is possible to get
I'm happy to change this patch to check the
Sphinx had made the same mistake a while ago