-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logs / errors are lost due to wsgi.errors
not extracted
#51
Comments
Thanks for the report. I'll need to investigate the history of why wsgi.errors is set to that. If you have a minimal test case that demonstrates the problem that you can share that would be great. |
The use of Setting it to So if you have the time to make a pull request that would be great and I'll get it merged and released asap. |
Here is the MVE: import flask
import requests
from wsgi_intercept.interceptor import RequestsInterceptor
app = flask.Flask(__name__)
@app.route('/')
def foo():
# cause a KeyError
return flask.jsonify({}['foo'])
def test_foo():
with RequestsInterceptor(lambda: app, host='foo.com', port=80) as url:
r = requests.get(url)
assert r.status_code == 200 Running it causes the error:
|
Will go on with PR soon! |
Hey there and thanks for a fancy tool!
I've noticed that interceptor puts a
io.BytestIO
towsgi.errors
.That causes some trouble:
unicode
there and fails withIMO putting a
sys.stderr
there would actually improve the situation.If it is a viable option I can go ahead and produce a pull request.
The text was updated successfully, but these errors were encountered: