Edgewall Software

Opened 5 years ago

Closed 4 years ago

#13063 closed defect (fixed)

TracStandalone should check for existence of environment path(s)

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.2.4
Component: web frontend/tracd Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
  • TracStandalone checks for existence of environment and authorization file paths.
  • Fixed absolute path not used for pidfile.
API Changes:
Internal Changes:


Attachments (0)

Change History (4)

comment:1 by Ryan J Ollos, 5 years ago

Proposed changes for trunk in [d8ff3e3d8/rjollos.git]. I'll prepare changes for 1.2-stable.

comment:3 by Jun Omae, 5 years ago

Testing the branch for 1.2-stable, value of --pidfile option is checked but error is not raised with non-existent file.

$ PYTHONPATH=. python -m trac.web.standalone --pidfile=/x.pid --port=3000 -e /
Server starting in PID 2988.
Serving on view at
Using HTTP/1.1 protocol version
  • parser.has_option('pidfile') should be parser.has_option('--pidfile')
  • I don't think the pid file should be checked. The file normally is not existent before running tracd. It would be created if not existent.
-    if parser.has_option('pidfile') and options.pidfile:
-        options.pidfile = to_abspath(options.pidfile)
+    if parser.has_option('--pidfile') and options.pidfile:
+        options.pidfile = os.path.abspath(options.pidfile)

Another thing, I consider we should use %s for path parameter rather than %r, especially for Windows ('C:\\path\\to\\tracenv' is printed instead of 'C:\path\to\tracenv').

-            raise parser.error("Path does not exist: %r" % path)
+            raise parser.error("Path does not exist: '%s'" % path)
Last edited 5 years ago by Jun Omae (previous) (diff)

comment:4 by Ryan J Ollos, 4 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Thank you for review and suggestions.

Changes committed to 1.2-stable in r16830, merged to trunk in r16831 (and r16832).

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.