qdiff: NameError when pygments not installed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QBzr |
Fix Released
|
High
|
Gary van der Merwe |
Bug Description
qdiff crashes at each diff, both calling it from qlog and directly through bzr qdiff.
I'm using latest bzr.dev and qbzr from right now.
~/.bazaar/
bzr: ERROR: exceptions.
Traceback (most recent call last):
File "/home/
ret_code = self._qbzr_
File "/home/
ui_
File "/w/bzr/
return obj(*args, **kwargs)
File "/home/
self.diffview = SidebySideDiffV
File "/home/
QtGui.
File "/home/
self.style = get_style_
NameError: global name 'get_style_by_name' is not defined
bzr 2.2.0dev1 on python 2.5.5 (Linux-
arguments: ['/w/bzr/
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'ca_ES.UTF-8'
plugins:
bzrtools /home/dc/
etckeeper /usr/lib/
explorer /home/dc/
fastimport /home/dc/
git /home/dc/
gtk /home/dc/
launchpad /home/w/
netrc_
news_merge /home/w/
push_and_update /home/dc/
qbzr /home/dc/
*** Bazaar has encountered an internal error. This probably indicates a
bug in Bazaar. You can help us fix it by filing a bug report at
https:/
including this traceback and a description of the problem.
Via bisect I tracked down the change at which this crash appeared:
On revision 1227.1.6 (<email address hidden>):
Better custom lazy import for pygments.
And from: bzr diff -c 1227.1.6
…
try:
- import pygments
+ from pygments.util import ClassNotFound
+ from pygments.styles import get_style_by_name
+ from pygments import lex
+ from pygments.lexers import get_lexer_
except ImportError:
else:
Maybe it's necessary to add an "except NameError"?
Related branches
Changed in qbzr: | |
assignee: | nobody → Gary van der Merwe (garyvdm) |
importance: | Undecided → High |
milestone: | none → 0.19b2 |
status: | New → Fix Released |
summary: |
- qdiff: NameError: global name 'get_style_by_name' is not defined + qdiff: NameError when pygments not installed |