[packages/trac/DEVEL] fix small error loading pygments css

glen glen at pld-linux.org
Mon Oct 8 18:16:35 CEST 2012


commit 946c1fc2eb61a17f860d2eb7af30dc1c6c62529f
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Mon Oct 8 19:16:19 2012 +0300

    fix small error loading pygments css

 pyc.patch | 21 +++++++++++++++++++++
 trac.spec |  4 +++-
 2 files changed, 24 insertions(+), 1 deletion(-)
---
diff --git a/trac.spec b/trac.spec
index dad5ffa..59eb243 100644
--- a/trac.spec
+++ b/trac.spec
@@ -6,7 +6,7 @@ Summary:	Integrated SCM, Wiki, Issue tracker and project environment
 Summary(pl.UTF-8):	Zintegrowane scm, wiki, system śledzenia problemów i środowisko projektowe
 Name:		trac
 Version:	1.0
-Release:	1.1
+Release:	1.3
 License:	BSD-like
 Group:		Applications/WWW
 Source0:	http://download.edgewall.org/trac/Trac-%{version}.tar.gz
@@ -20,6 +20,7 @@ Patch0:		%{name}-root2http.patch
 Patch1:		%{name}-defaults.patch
 Patch2:		inherit-global-%{name}.ini.patch
 Patch3:		silvercity-javascript-mimetypes.patch
+Patch4:		pyc.patch
 URL:		http://trac.edgewall.org/
 BuildRequires:	python >= 1:2.5
 BuildRequires:	python-babel >= 0.9.6
@@ -95,6 +96,7 @@ Trac Python modules.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
 
 # using system jquery package
 %{__rm} trac/htdocs/js/jquery.js
diff --git a/pyc.patch b/pyc.patch
new file mode 100644
index 0000000..ea5b551
--- /dev/null
+++ b/pyc.patch
@@ -0,0 +1,21 @@
+Fix locating .py class
+
+2012-10-08 18:56:59,989 Trac[main] ERROR: Internal Server Error:
+Traceback (most recent call last):
+  File "/usr/share/python2.7/site-packages/trac/web/main.py", line 497, in _dispatch_request
+  File "/usr/share/python2.7/site-packages/trac/web/main.py", line 214, in dispatch
+  File "/usr/share/python2.7/site-packages/trac/mimeview/pygments.py", line 168, in process_request
+  File "/usr/share/python2.7/genericpath.py", line 54, in getmtime
+OSError: [Errno 2] No such file or directory: '/usr/share/python2.7/site-packages/pygments/styles/trac.py'
+--- Trac-1.0/./trac/mimeview/pygments.py~	2012-09-08 00:58:08.000000000 +0300
++++ Trac-1.0/./trac/mimeview/pygments.py	2012-10-08 18:59:19.289104253 +0300
+@@ -165,6 +165,9 @@
+ 
+         parts = style_cls.__module__.split('.')
+         filename = resource_filename('.'.join(parts[:-1]), parts[-1] + '.py')
++        if not os.path.exists(filename):
++            filename = resource_filename('.'.join(parts[:-1]), parts[-1] + '.pyc')
++
+         mtime = datetime.fromtimestamp(os.path.getmtime(filename), localtz)
+         last_modified = http_date(mtime)
+         if last_modified == req.get_header('If-Modified-Since'):
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/trac.git/commitdiff/946c1fc2eb61a17f860d2eb7af30dc1c6c62529f



More information about the pld-cvs-commit mailing list