Modify ↓
#9657 closed defect (fixed)
I get "NameError: global name 'any' is not defined" when adding new repository.
Reported by: | Jun Omae | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Milestone: | 0.12.1 |
Component: | admin/web | Version: | 0.12-stable |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
I get the below error when I add new repository in "Manage Repositoies" page with CentOS 5.5 and python 2.4.3.
2010-10-01 20:24:46,474 Trac[main] ERROR: Internal Server Error: Traceback (most recent call last): File "/home/jun66j5/src/trac.git/trac/web/main.py", line 511, in _dispatch_request dispatcher.dispatch(req) File "/home/jun66j5/src/trac.git/trac/web/main.py", line 237, in dispatch resp = chosen_handler.process_request(req) File "/home/jun66j5/src/trac.git/trac/admin/web_ui.py", line 116, in process_request path_info) File "/home/jun66j5/src/trac.git/trac/versioncontrol/admin.py", line 255, in render_admin_panel elif self._check_dir(req, dir): File "/home/jun66j5/src/trac.git/trac/versioncontrol/admin.py", line 346, in _check_dir if prefixes and not any(is_path_below(dir, prefix) NameError: global name 'any' is not defined
It should use trac.util.compact.any
with python 2.4.
-
trac/versioncontrol/admin.py
diff --git a/trac/versioncontrol/admin.py b/trac/versioncontrol/admin.py index fcb1369..513b164 100644
a b from trac.config import _TRUE_VALUES, ListOption 21 21 from trac.core import * 22 22 from trac.perm import IPermissionRequestor 23 23 from trac.util import is_path_below 24 from trac.util.compat import any 24 25 from trac.util.text import breakable_path, normalize_whitespace, print_table, \ 25 26 printout 26 27 from trac.util.translation import _, ngettext, tag_
Trac | 0.12.1dev |
Babel | 0.9.5 |
Genshi | 0.6 |
Pygments | 1.1.1 |
pysqlite | 2.3.3 |
Python | 2.4.3 (#1, Sep 3 2009, 15:37:12) [GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] |
pytz | 2010h |
setuptools | 0.6 |
SQLite | 3.3.6 |
Subversion | 1.6.12 (r955767) |
jQuery | 1.4.2 |
Attachments (0)
Change History (7)
comment:1 by , 14 years ago
comment:2 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Good catch, thanks! Patch applied in [10155].
comment:3 by , 14 years ago
Owner: | set to |
---|
comment:5 by , 14 years ago
To prevent future breakage, we could push any()
and all()
into __builtin__
if they aren't there already.
comment:6 by , 14 years ago
Please don't assume that Trac is the only code running in a process, and avoid any magic that extends beyond the confines of the trac namespace.
Note:
See TracTickets
for help on using tickets.
Just in time for the rc1, thanks!