Ah, ok I should explain more what I'm after. The traceback is always provided in the response, but the Trac code filters it out. For example, one can do:
curl -s "trac-site/bad-url"
And in the server response will be a traceback, like:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/trac/web/main.py", line 610, in dispatch_request
dispatcher.dispatch(req)
[...]
I'd like to disable the traceback unless I do something like set "debug=1" in trac.ini or something similar.
As of now, I've manually edited "site-packages/trac/__init__.py" to include:
import
sys
sys.tracebacklimit=0
Which does the trick. However, that change will be overwritten for every new install/upgrade.