diff roundup/cgi/client.py @ 7905:f47b186a2ad9

fix use of '-' directory in static files Under windows, the test for - to prevent using the html directory for resolving static files did not work. Fixed as part of getting test suite to run under windows.
author John Rouillard <rouilj@ieee.org>
date Sat, 27 Apr 2024 21:03:20 -0400
parents f11c982f01c8
children 67922fd17454
line wrap: on
line diff
--- a/roundup/cgi/client.py	Thu Apr 25 18:34:37 2024 -0400
+++ b/roundup/cgi/client.py	Sat Apr 27 21:03:20 2024 -0400
@@ -1934,9 +1934,10 @@
 
             for p in prefix:
                 # if last element of STATIC_FILES ends with '/-',
-                # we failed to find the file and we should
-                # not look in TEMPLATES. So raise exception.
-                if dir_option == 'STATIC_FILES' and p[-2:] == '/-':
+                # or \- on windows, we failed to find the file
+                # and should not look in TEMPLATES. So raise exception.
+                if (dir_option == 'STATIC_FILES' and p[-1:] == '-' and
+                    p[-2:-1] in ('/', '\\')):
                     raise NotFound(file)
 
                 # ensure the load doesn't try to poke outside

Roundup Issue Tracker: http://roundup-tracker.org/