#13574 closed defect (fixed)
Missing import in deploy_trac.fcgi
Reported by: | Owned by: | Jun Omae | |
---|---|---|---|
Priority: | normal | Milestone: | 1.4.4 |
Component: | general | Version: | 1.5.4 |
Severity: | trivial | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Removed unnecessary exception handling from |
||
API Changes: | |||
Internal Changes: |
Description
deploy_trac.fcgi calls sys.stdout but doesn't import sys, the Apache error.log reports it:
NameError: name 'sys' is not defined: /var/www/projects/myproject/cgi-bin/trac.fcgi
Due to this stacktraces are displayed in the Apache log and not on the web page.
Attachments (0)
Change History (5)
comment:1 by , 21 months ago
comment:2 by , 21 months ago
Milestone: | → 1.6 |
---|
comment:3 by , 21 months ago
Owner: | set to |
---|---|
Status: | new → assigned |
The fastcgi script writes traceback of the exception which formatted "Content-Type: text/plain", however the output is received by the process that started the fascgi script (e.g. mod_fcgid), not the web client. So that I don't think the script needs to catch and format the exception.
-
trac/web/templates/deploy_trac.fcgi
diff --git a/trac/web/templates/deploy_trac.fcgi b/trac/web/templates/deploy_trac.fcgi index be526b647..866635d9b 100644
a b 15 15 {##}# 16 16 {##}# Author: Jonas Borgström <jonas@edgewall.com> 17 17 18 try:18 def main(): 19 19 import os 20 20 import pkg_resources 21 21 if 'TRAC_ENV' not in os.environ and \ … … try: 30 30 pkg_resources.set_extraction_path(egg_cache) 31 31 from trac.web import fcgi_frontend 32 32 fcgi_frontend.run() 33 except SystemExit: 34 raise 35 except Exception as e: 36 print("Content-Type: text/plain", end="\r\n") 37 print("", end="\r\n") 38 print("Oops...") 39 print("") 40 print("Trac detected an internal error:") 41 print("") 42 print(e) 43 print("", flush=True) 44 import traceback 45 traceback.print_exc(file=sys.stdout) 33 34 if __name__ == '__main__': 35 main()
comment:4 by , 21 months ago
Milestone: | 1.6 → 1.4.4 |
---|---|
Release Notes: | modified (diff) |
Resolution: | → fixed |
Status: | assigned → closed |
comment:5 by , 16 months ago
Release Notes: | modified (diff) |
---|
Good catch. Looks like it was overlooked in r17541 / #13403.
We should likely fix it before releasing 1.6.