Modify ↓
Opened 5 years ago
Last modified 4 years ago
#13231 new defect
Egg files without SOURCES.txt not displayed correctly on plugin admin page
Reported by: | Ryan J Ollos | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 1.6.1 |
Component: | general | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
Discussed in gmessage:trac-users:AUBRFehR83c/ZRjKm-SnCAAJ
Trac Debian package should have *.egg-info/SOURCES.txt
file. Searching the SOURCES.txt
file in debian packages, several packages have SOURCES.txt file.
(If *.dist-info structure is used, RECORD file must be included. (2))
However, according to The Internal Structure of Python Eggs (1), it seems that it is possible to have no SOURCES.txt
file in egg-info structure.
Work around:
-
trac/util/__init__.py
diff --git a/trac/util/__init__.py b/trac/util/__init__.py index 1d3485e09..8808ebf90 100644
a b def get_sources(path): 700 700 """Return a dictionary mapping Python module source paths to the 701 701 distributions that contain them. 702 702 """ 703 path = os.path.normpath(os.path.abspath(path)) 703 704 sources = {} 704 705 for dist in find_distributions(path, only=True): 705 706 if not dist.has_metadata('top_level.txt'): … … def get_sources(path): 717 718 for row in reader if any(row[0].startswith(top) 718 719 for top in toplevels)) 719 720 continue 721 for top in toplevels: 722 dir_ = os.path.normpath(os.path.join(dist.location, 723 top.rstrip('/'))) 724 if not os.path.isdir(dir_): 725 continue 726 for root, dirs, files in os.walk(dir_): 727 for filename in files: 728 if not filename.endswith('.py'): 729 continue 730 filename = os.path.join(root, filename) 731 sources[filename[len(path):].strip(os.sep) 732 .replace(os.sep, '/')] = dist 720 733 return sources
Attachments (0)
Change History (5)
comment:1 by , 5 years ago
Milestone: | next-stable-1.2.x → next-stable-1.4.x |
---|
comment:2 by , 5 years ago
Milestone: | next-stable-1.4.x → 1.4.3 |
---|
comment:3 by , 4 years ago
Milestone: | 1.4.3 → 1.5.3 |
---|
comment:4 by , 4 years ago
Milestone: | 1.5.3 → 1.5.4 |
---|
comment:5 by , 4 years ago
Milestone: | 1.5.4 → 1.6.1 |
---|
Note:
See TracTickets
for help on using tickets.