Modify

Opened 3 years ago

Closed 19 months ago

#9877 closed defect (fixed)

Exporting cause Trac Internal Error: UnicodeEncodeError

Reported by: anonymous Owned by: abompard
Priority: normal Component: OdtExportPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description

Some wiki pages cause an internal error with the following message:

UnicodeEncodeError: 'ascii' codec can't encode characters in position 8-9: ordinal not in range(128)

Python tracebak:

File "/usr/lib/python2.6/site-packages/Trac-0.12.2-py2.6.egg/trac/web/main.py", line 511, in _dispatch_request
File "/usr/lib/python2.6/site-packages/Trac-0.12.2-py2.6.egg/trac/web/main.py", line 237, in dispatch
File "/usr/lib/python2.6/site-packages/Trac-0.12.2-py2.6.egg/trac/wiki/web_ui.py", line 172, in process_request
File "/usr/lib/python2.6/site-packages/Trac-0.12.2-py2.6.egg/trac/mimeview/api.py", line 983, in send_converted
File "/usr/lib/python2.6/site-packages/Trac-0.12.2-py2.6.egg/trac/mimeview/api.py", line 682, in convert_content
File "/usr/lib/python2.6/site-packages/OdtExportPlugin-0.6-py2.6.egg/odtexport/odtexport.py", line 94, in convert_content
File "/usr/lib/python2.6/site-packages/OdtExportPlugin-0.6-py2.6.egg/odtexport/odtexport.py", line 220, in import_xhtml
File "/usr/lib/python2.6/site-packages/OdtExportPlugin-0.6-py2.6.egg/odtexport/odtexport.py", line 368, in insert_content 

System Information:

Trac 	        0.12.2
Babel 	        0.9.4
Genshi 	        0.6
mod_wsgi 	3.2 (WSGIProcessGroup WSGIApplicationGroup %{GLOBAL})
pysqlite 	2.4.1
Python 	        2.6.6 (r266:84292, Dec 7 2011, 20:48:22) [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)]
setuptools 	0.6
SQLite 	        3.6.20
Subversion 	1.6.11 (r934486)
jQuery	        1.4.2
  • Plugin version:
    OdtExportPlugin 	0.6 	/usr/lib/python2.6/site-packages/OdtExportPlugin-0.6-py2.6.egg
    
  • Notes:
    • The charset used is charset=UTF-8
    • This occurs in some wikis only
    • Some wikis are written in Portuguese


Attachments (0)

Change History (3)

comment:1 Changed 3 years ago by anonymous

  • Trac Release changed from 0.11 to 0.12
  • trac version was wrong :)

comment:2 Changed 2 years ago by anonymous

if patch .../odtexportplugin/0.11/odtexport/odtexport.py

nano .../odtexportplugin/0.11/odtexport/odtexport.py
#before
'wikiname': str(self.page_name),
#after
'wikiname': unicode(self.page_name),
#Then 
python setup.py bdist_egg

And export to OpenDocument work well.
I test in in "unicode" russian page name.

comment:3 Changed 19 months ago by rjollos

  • Resolution set to fixed
  • Status changed from new to closed

(In [12787]) Fixes #9877: Fixed UnicodeEncodeError when trying to export a wiki page with unicode characters in the page name.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.