Edgewall Software
Modify

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#11820 closed defect (duplicate)

pygments 2.0 & 2.0.1 does not work

Reported by: anonymous Owned by:
Priority: normal Milestone:
Component: general Version: 1.0.4
Severity: major Keywords: pygments
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I just updated my pygments from 1.6 to 2.0.1 on my trac 1.0.2 and noticed that syntax highlighting does not work anymore.

Aktivating the log file I can see that the plugin load crashes.

I use:

  • win7 64 bit
  • python 2.7.8 32 bit
2014-11-12 08:43:36,711 Trac[loader] ERROR: Skipping "trac.mimeview.pygments = trac.mimeview.pygments [pygments]": 
Traceback (most recent call last):
  File "D:\Programme\python27\lib\site-packages\trac\loader.py", line 68, in _load_eggs
    entry.load(require=True)
  File "build\bdist.win32\egg\pkg_resources.py", line 2184, in load
    ['__name__'])
  File "D:\Programme\python27\lib\site-packages\trac\mimeview\pygments.py", line 37, in <module>
    HtmlFormatter = pygments.formatters.html.HtmlFormatter
  File "D:\Programme\python27\lib\site-packages\pygments\formatters\__init__.py", line 111, in __getattr__
    raise AttributeError(name)
AttributeError: html

Attachments (0)

Change History (9)

comment:1 by Jun Omae, 9 years ago

Resolution: duplicate
Status: newclosed

A duplicate of #11796.

comment:2 by anonymous, 9 years ago

Resolution: duplicate
Status: closedreopened
Version: 1.0.21.0.4

Reopening against 1.0.4. I know this was closed as duplicate of #11796, but it does not look to be the same issue.

In Trac 1.0.4 using Pygments 2.0.2 I get the following error log, which is consistent with this ticket's description. Pygments 1.6 works fine.

Environment Win7 x64, 32-bit Python

Package Version
Trac 1.0.4 
Docutils 0.12 
Genshi 0.6 (without speedups) 
mod_python 3.3.1 
Pygments 1.6 
pysqlite 2.4.1 
Python 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)] 
setuptools 1.4.1 
SQLite 3.5.9 
Subversion 1.8.5 (r1542147) 
jQuery 1.7.2 

Error log

2015-03-08 22:37:00,446 Trac[loader] ERROR: Skipping "codeexample = codeexample": 
Traceback (most recent call last):
  File "C:\Program Files (x86)\VisualSVN Server\trac\python\lib\site-packages\trac\loader.py", line 68, in _load_eggs
    entry.load(require=True)
  File "C:\Program Files (x86)\VisualSVN Server\trac\python\lib\site-packages\pkg_resources.py", line 2108, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "build\bdist.win32\egg\codeexample\__init__.py", line 1, in <module>
  File "build\bdist.win32\egg\codeexample\code_example_processor.py", line 41, in <module>
  File "C:\Program Files (x86)\VisualSVN Server\trac\python\lib\site-packages\trac\mimeview\pygments.py", line 37, in <module>
    HtmlFormatter = pygments.formatters.html.HtmlFormatter
  File "C:\Program Files (x86)\VisualSVN Server\trac\python\lib\site-packages\pygments-2.0.2-py2.6.egg\pygments\formatters\__init__.py", line 111, in __getattr__
    raise AttributeError(name)
AttributeError: html

in reply to:  2 comment:3 by ilewismsl, 9 years ago

Replying to anonymous:

Reopening against 1.0.4.

Should have been by ilewismsl

in reply to:  2 ; comment:4 by Jun Omae, 9 years ago

Resolution: duplicate
Status: reopenedclosed
  File "C:\Program Files (x86)\VisualSVN Server\trac\python\lib\site-packages\trac\mimeview\pygments.py", line 37, in <module>
    HtmlFormatter = pygments.formatters.html.HtmlFormatter

It seems that you still use Trac 1.0.2.

in reply to:  2 comment:5 by ilewismsl, 9 years ago

Replying to anonymous:

Reopening against 1.0.4.

Doing really well here. I got the wrong error log entry.

2015-03-08 22:37:00,476 Trac[loader] ERROR: Skipping "trac.mimeview.pygments = trac.mimeview.pygments [pygments]": 
Traceback (most recent call last):
  File "C:\Program Files (x86)\VisualSVN Server\trac\python\lib\site-packages\trac\loader.py", line 68, in _load_eggs
    entry.load(require=True)
  File "C:\Program Files (x86)\VisualSVN Server\trac\python\lib\site-packages\pkg_resources.py", line 2108, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "C:\Program Files (x86)\VisualSVN Server\trac\python\lib\site-packages\trac\mimeview\pygments.py", line 37, in <module>
    HtmlFormatter = pygments.formatters.html.HtmlFormatter
  File "C:\Program Files (x86)\VisualSVN Server\trac\python\lib\site-packages\pygments-2.0.2-py2.6.egg\pygments\formatters\__init__.py", line 111, in __getattr__
    raise AttributeError(name)
AttributeError: html

in reply to:  4 comment:6 by ilewismsl, 9 years ago

Replying to jomae:

It seems that you still use Trac 1.0.2.

I do not think that is true. Here is the start of my Trac startup log

2015-03-08 22:37:00,352 Trac[env] INFO: -------------------------------- environment startup [Trac 1.0.4] --------------------------------

comment:7 by Jun Omae, 9 years ago

I consider you have an InstallationIssue. Installed Trac code in your environment is 1.0.2. Trac's egg-info is only 1.0.4. Otherwise, you probably haven't restarted your web server.

  1. Stop your web server
  2. Remove lib/site-packages/trac, lib/site-packages/tracopt and lib/site-packages/Trac-*.egg-info
  3. Reinstall Trac 1.0.4
  4. Start your web server

comment:8 by Jun Omae, 9 years ago

Keywords: pygments added

in reply to:  7 comment:9 by ilewismsl, 9 years ago

Replying to jomae:

I consider you have an InstallationIssue.

You are correct. I had stopped the server during upgrade. But, I did not delete all old site-packages prior to install. I did not know it was possible for the log to say one version of Trac, but for the actual running system to be another version. I had assumed the egg was self-contained for core components.

Sorry to reopen a ticket for a site configuration error.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.