Ticket #2169 (closed defect: fixed)

Opened 1 year ago

Last modified 7 months ago

Plugin throws if non-directories exist in trac environment root

Reported by: JasonWinnebeck Assigned to: anonymous
Priority: normal Component: SearchAllPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description

Plugin fails if non-directories exist in trac environment root, below is a patch to ensure that the file isn't a directory before trying to open it as a environment. Not included in this patch as I didn't need it would be to also catch an exception from the open environment command, because even if it is a directory it's possible that it is not a Trac environment.

Index: tracsearchall/searchall.py
===================================================================
--- tracsearchall/searchall.py  (revision 2767)
+++ tracsearchall/searchall.py  (working copy)
@@ -52,11 +52,14 @@
             # skip our own project
             if project == this_project:
                 continue
-
+
             # make up URL for project
             project_url = '/'.join( (base_url, project) )

             project_path = os.path.join(search_path,project)
+            if not os.path.isdir( project_path ):
+                continue
+
             env = open_environment(project_path)

Attachments

Change History

06/23/08 02:29:28 changed by anonymous

  • owner changed from airadier to anonymous.
  • status changed from new to assigned.

Applied, thanks

06/23/08 02:29:33 changed by anonymous

  • status changed from assigned to closed.
  • resolution set to fixed.

06/23/08 02:29:58 changed by airadier

(In [3885]) Closed #2169


Add/Change #2169 (Plugin throws if non-directories exist in trac environment root)




Change Properties
Action