Modify

Opened 10 years ago

Last modified 7 years ago

#11522 new defect

UnicodeError: source returned bytes, but no encoding specified

Reported by: barclay@… Owned by: Roberto Longobardi
Priority: normal Component: FaqPlugin
Severity: blocker Keywords:
Cc: Trac Release: 1.0

Description

From a fresh install, after applying the patch in #9976 for PostgreSQL, when I click on the main FAQs navigation button I get:

Trac detected an internal error:
UnicodeError: source returned bytes, but no encoding specified

Python callback:

File "build/bdist.macosx-10.9-intel/egg/trac/web/main.py", line 497, in _dispatch_request
  dispatcher.dispatch(req)
File "build/bdist.macosx-10.9-intel/egg/trac/web/main.py", line 233, in dispatch
  content_type)
File "build/bdist.macosx-10.9-intel/egg/trac/web/chrome.py", line 968, in render_template
  stream |= self._filter_stream(req, method, filename, stream, data)
File "/Library/Python/2.7/site-packages/Genshi-0.7-py2.7-macosx-10.9-intel.egg/genshi/core.py", line 133, in __or__
  return Stream(_ensure(function(self)), serializer=self.serializer)
File "build/bdist.macosx-10.9-intel/egg/trac/web/chrome.py", line 1147, in inner
  data)
File "build/bdist.macosx-10.9-intel/egg/faqplugin/wiki.py", line 66, in filter_stream
  return self._faq_category_wiki_view(req, formatter, page_name, stream)
File "build/bdist.macosx-10.9-intel/egg/faqplugin/wiki.py", line 91, in _faq_category_wiki_view
  HTML(tree_macro.expand_macro(formatter, None, ''))
File "/Library/Python/2.7/site-packages/Genshi-0.7-py2.7-macosx-10.9-intel.egg/genshi/input.py", line 442, in HTML
  return Stream(list(HTMLParser(BytesIO(text), encoding=encoding)))
File "/Library/Python/2.7/site-packages/Genshi-0.7-py2.7-macosx-10.9-intel.egg/genshi/core.py", line 273, in _ensure
  event = stream.next()
File "/Library/Python/2.7/site-packages/Genshi-0.7-py2.7-macosx-10.9-intel.egg/genshi/input.py", line 449, in _coalesce
  for kind, data, pos in chain(stream, [(None, None, None)]):
File "/Library/Python/2.7/site-packages/Genshi-0.7-py2.7-macosx-10.9-intel.egg/genshi/input.py", line 337, in _generate
  raise UnicodeError("source returned bytes, but no encoding specified")

Note that I'm using Trac 1.0.1 with PostgreSQL, see attached

Attachments (2)

tracfaq.jpeg (297.1 KB) - added by barclay@… 10 years ago.
my setup
unicode.patch (2.1 KB) - added by Aleksandr 7 years ago.
quick workaround (sashk)

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by barclay@…

Attachment: tracfaq.jpeg added

my setup

comment:1 Changed 10 years ago by anonymous

My setup is:

my setup

comment:2 Changed 10 years ago by anonymous

Trac Release: 1.0

comment:3 Changed 9 years ago by Ryan J Ollos

You can work around by downgrading to Genshi 0.6.1.

Changed 7 years ago by Aleksandr

Attachment: unicode.patch added

quick workaround (sashk)

comment:4 Changed 7 years ago by Aleksandr

Quick/dirty workaround (based on UnicodeGuidelines)

Version 1, edited 7 years ago by Ryan J Ollos (previous) (next) (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Roberto Longobardi.

Add Comment


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

 
Note: See TracTickets for help on using tickets.