Modify

Opened 13 years ago

Closed 13 years ago

Last modified 3 years ago

#8154 closed defect (fixed)

LookupError: unknown encoding: cp0

Reported by: achim@… Owned by: Roberto Longobardi
Priority: normal Component: TestManagerForTracPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

I get the following error with version 1.3.8.

LookupError: unknown encoding: cp0

Python Traceback
Most recent call last:

    * File "C:\Python25\lib\site-packages\trac\web\main.py", line 423, in _dispatch_request
      Code fragment:
       418. try:
       419. if not env and env_error:
       420. raise HTTPInternalError(env_error)
       421. try:
       422. dispatcher = RequestDispatcher(env)
       423. dispatcher.dispatch(req)
       424. except RequestDone:
       425. pass
       426. resp = req._response or []
       427.  
       428. except HTTPException, e:
      Local variables:
      Name	Value
      after 	[u' except RequestDone:', u' pass', u' resp = ...
      before 	[u' try:', u' if not env and env_error:', u' raise ...
      dispatcher 	<trac.web.main.RequestDispatcher object at 0x0413FC50>
      e 	LookupError('unknown encoding: cp0',)
      env 	<trac.env.Environment object at 0x041379F0>
      env_error 	None
      exc_info 	(<type 'exceptions.LookupError'>, LookupError('unknown encoding: cp0',), ...
      filename 	'C:\\Python25\\lib\\site-packages\\trac\\web\\main.py'
      frames 	[{'function': '_dispatch_request', 'lines_before': [u' try:', u' ...
      has_admin 	True
      line 	u' dispatcher.dispatch(req)'
      lineno 	422
      message 	u'LookupError: unknown encoding: cp0'
      req 	<Request "GET u'/wiki/TC_TT7'">
      resp 	[]
      tb 	<traceback object at 0x043D5620>
      tb_hide 	None
      traceback 	'Traceback (most recent call last):\n File ...
    * File "C:\Python25\lib\site-packages\trac\web\main.py", line 219, in dispatch
      Code fragment:
       214. out = StringIO()
       215. pprint(data, out)
       216. req.send(out.getvalue(), 'text/plain')
       217. else:
       218. output = chrome.render_template(req, template,
       219. data, content_type)
       220. # Give the session a chance to persist changes
       221. if req.session:
       222. req.session.save()
       223.  
       224. req.send(output, content_type or 'text/html')
      Local variables:
      Name	Value
      chosen_handler 	<trac.wiki.web_ui.WikiModule object at 0x0413FF70>
      chrome 	<trac.web.chrome.Chrome object at 0x03FE1DB0>
      content_type 	None
      data 	{'templates': [], 'dateinfo': <function dateinfo at 0x0428ED30>, ...
      err 	(<type 'exceptions.LookupError'>, LookupError('unknown encoding: cp0',), ...
      handler 	<trac.wiki.web_ui.WikiModule object at 0x0413FF70>
      req 	<Request "GET u'/wiki/TC_TT7'">
      resp 	('wiki_view.html', {'templates': [], 'dateinfo': <function dateinfo at ...
      self 	<trac.web.main.RequestDispatcher object at 0x0413FC50>
      template 	'wiki_view.html'
    * File "C:\Python25\lib\site-packages\trac\web\chrome.py", line 690, in render_template
      Code fragment:
       685.  
       686. stream = template.generate(**data)
       687.  
       688. # Filter through ITemplateStreamFilter plugins
       689. if self.stream_filters:
       690. stream |= self._filter_stream(req, method, filename, stream, data)
       691.  
       692. if fragment:
       693. return stream
       694.  
       695. if method == 'text':
      Local variables:
      Name	Value
      content_type 	'text/html'
      data 	{'abs_url_of': <function get_abs_url at 0x043A3DB0>, 'templates': [], ...
      filename 	'wiki_view.html'
      fragment 	False
      method 	'xhtml'
      req 	<Request "GET u'/wiki/TC_TT7'">
      self 	<trac.web.chrome.Chrome object at 0x03FE1DB0>
      stream 	<genshi.core.Stream object at 0x040DEB70>
      template 	<MarkupTemplate "wiki_view.html">
    * File "build\bdist.win32\egg\genshi\core.py", line 128, in __or__
      Local variables:
      Name	Value
      function 	<function inner at 0x043A3FB0>
      self 	<genshi.core.Stream object at 0x040DEB70>
    * File "C:\Python25\lib\site-packages\trac\web\chrome.py", line 777, in inner
      Code fragment:
       772.  
       773. def _filter_stream(self, req, method, filename, stream, data):
       774. def inner(stream, ctxt=None):
       775. for filter in self.stream_filters:
       776. stream = filter.filter_stream(req, method, filename, stream,
       777. data)
       778. return stream
       779. return inner
       780.  
      Local variables:
      Name	Value
      ctxt 	None
      data 	{'abs_url_of': <function get_abs_url at 0x043A3DB0>, 'templates': [], ...
      filename 	'wiki_view.html'
      filter 	<testmanager.wiki.WikiTestManagerInterface object at 0x04306090>
      method 	'xhtml'
      req 	<Request "GET u'/wiki/TC_TT7'">
      self 	<trac.web.chrome.Chrome object at 0x03FE1DB0>
      stream 	<genshi.core.Stream object at 0x040DEB70>
    * File "build\bdist.win32\egg\testmanager\wiki.py", line 106, in filter_stream
      Local variables:
      Name	Value
      data 	{'abs_url_of': <function get_abs_url at 0x043A3DB0>, 'templates': [], ...
      filename 	'wiki_view.html'
      formatter 	<trac.wiki.formatter.Formatter object at 0x043BE870>
      method 	'xhtml'
      page_name 	u'TC_TT7'
      planid 	'-1'
      req 	<Request "GET u'/wiki/TC_TT7'">
      self 	<testmanager.wiki.WikiTestManagerInterface object at 0x04306090>
      stream 	<genshi.core.Stream object at 0x040DEB70>
    * File "build\bdist.win32\egg\testmanager\wiki.py", line 148, in _catalog_wiki_view
      Local variables:
      Name	Value
      cat_id 	u'7'
      cat_name 	u'TC_TT7'
      formatter 	<trac.wiki.formatter.Formatter object at 0x043BE870>
      fulldetails 	'False'
      mode 	'tree'
      page_name 	u'TC_TT7'
      path_name 	u'/wiki/TC_TT7'
      req 	<Request "GET u'/wiki/TC_TT7'">
      self 	<testmanager.wiki.WikiTestManagerInterface object at 0x04306090>
      stream 	<genshi.core.Stream object at 0x040DEB70>
      test_catalog 	<testmanager.model.TestCatalog object at 0x043BEF50>
      tmmodelprovider 	<tracgenericclass.model.GenericClassModelProvider object at 0x043AF6B0>
      tree_macro 	<testmanager.macros.TestCaseTreeMacro object at 0x043DB730>
    * File "build\bdist.win32\egg\testmanager\wiki.py", line 406, in _get_breadcrumb_markup
      Local variables:
      Name	Value
      breadcrumb_macro 	<testmanager.macros.TestCaseBreadcrumbMacro object at 0x043DB710>
      formatter 	<trac.wiki.formatter.Formatter object at 0x043BE870>
      fulldetails 	'False'
      mode 	'tree'
      page_name 	u'TC_TT7'
      planid 	None
      self 	<testmanager.wiki.WikiTestManagerInterface object at 0x04306090>
    * File "build\bdist.win32\egg\testmanager\macros.py", line 58, in expand_macro
      Local variables:
      Name	Value
      args 	[]
      content 	u'page_name=TC_TT7,mode=tree,fulldetails=False'
      formatter 	<trac.wiki.formatter.Formatter object at 0x043BE870>
      fulldetails 	False
      kw 	{'fulldetails': u'False', 'page_name': u'TC_TT7', 'mode': u'tree'}
      mode 	u'tree'
      name 	None
      page_name 	u'TC_TT7'
      planid 	'-1'
      req 	<Request "GET u'/wiki/TC_TT7'">
      self 	<testmanager.macros.TestCaseBreadcrumbMacro object at 0x043DB710>
    * File "build\bdist.win32\egg\testmanager\macros.py", line 230, in _build_testcases_breadcrumb
      Local variables:
      Name	Value
      breadcrumb 	[{'id': 'TC', 'name': 'TC', 'title': 'All Catalogs'}, {'id': u'TC_TT7', ...
      cat_name 	u'TT7'
      curpage 	u'TC_TT7'
      curr_path 	u'TC_TT7'
      env 	<trac.env.Environment object at 0x041379F0>
      fulldetails 	False
      i 	0
      mode 	u'tree'
      page 	<trac.wiki.model.WikiPage object at 0x043BE430>
      page_title 	u'Das ist ein Test'
      path_name 	u'TT7'
      planid 	'-1'
      req 	<Request "GET u'/wiki/TC_TT7'">
      tc 	u'TT7'
      text 	u'<div><span name="breadcrumb" style="cursor: pointer; color: #BB0000; ...
      tokens 	[u'TT7']

File "C:\Python25\lib\site-packages\trac\web\main.py", line 423, in _dispatch_request
  dispatcher.dispatch(req)
File "C:\Python25\lib\site-packages\trac\web\main.py", line 219, in dispatch
  data, content_type)
File "C:\Python25\lib\site-packages\trac\web\chrome.py", line 690, in render_template
  stream |= self._filter_stream(req, method, filename, stream, data)
File "build\bdist.win32\egg\genshi\core.py", line 128, in __or__File "C:\Python25\lib\site-packages\trac\web\chrome.py", line 777, in inner
  data)
File "build\bdist.win32\egg\testmanager\wiki.py", line 106, in filter_streamFile "build\bdist.win32\egg\testmanager\wiki.py", line 148, in _catalog_wiki_viewFile "build\bdist.win32\egg\testmanager\wiki.py", line 406, in _get_breadcrumb_markupFile "build\bdist.win32\egg\testmanager\macros.py", line 58, in expand_macroFile "build\bdist.win32\egg\testmanager\macros.py", line 230, in _build_testcases_breadcrumb

Trac:  	0.11.1
Python: 	2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)]
setuptools: 	0.6c8
SQLite: 	3.6.10
pysqlite: 	2.3.2
Genshi: 	0.5.1
mod_python: 	3.3.1
Pygments: 	1.3.1
Subversion: 	1.5.3 (r33570)
RPC: 	1.0.6
jQuery:	1.2.6

Attachments (1)

macros.py (31.5 KB) - added by Roberto Longobardi 13 years ago.
Patched marcos.py

Download all attachments as: .zip

Change History (4)

Changed 13 years ago by Roberto Longobardi

Attachment: macros.py added

Patched marcos.py

comment:1 Changed 13 years ago by Roberto Longobardi

Mhhh, I searched around for an idea about this problem, but it looks odd...

Would you try to replace the file: testman4trac/trunk/testmanager/macros.py

with the attached one: http://trac-hacks.org/attachment/ticket/8154/macros.py?format=raw

build (with ". ./build.sh") and replace the test manager plugin, and let me know if it works?

Another thing you may try is to follow the instructions in this post: http://bugs.python.org/issue6501

they require some Apache tweacking.

Ciao, Roberto

Version 0, edited 13 years ago by Roberto Longobardi (next)

comment:2 Changed 13 years ago by Roberto Longobardi

Status: newassigned

Another user reported this and confirmed the fix works.

Going to ship the fix with 1.3.10 tomorrow.

comment:3 Changed 13 years ago by Roberto Longobardi

Resolution: fixed
Status: assignedclosed

Fixed with 1.3.10.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Roberto Longobardi.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.