Modify

Opened 13 years ago

Closed 13 years ago

#9849 closed defect (fixed)

UnicodeEncodeError: 'latin-1' codec can't encode character u'\u0159' in position 2: ordinal not in range(256)

Reported by: pkloud Owned by: Robert Verspuy
Priority: normal Component: PhpdocPlugin
Severity: major Keywords:
Cc: Trac Release: 0.12

Description

How to Reproduce

While doing a GET operation on /search, Trac issued an internal error.

Any search including characters with diacritics such as ěščřžýáíéúů...etc. fails with same (just for another char) problem on phpDoc plugin.

Request parameters:

{'q': u'po\u0159ad\xed'}

User agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20100101 Firefox/10.0.2

System Information

Trac 0.12
Genshi 0.6
mod_python 3.3.1
MySQL server: "5.0.37", client: "5.0.37", thread-safe: 0
MySQLdb 1.2.1_p2
Pygments 1.4
Python 2.5 (r25:51908, May 7 2007, 13:29:29)
[GCC 4.1.2 20070302 (prerelease) (4.1.2-1mdv2007.1)]
setuptools 0.6c11
jQuery 1.4.2

Enabled Plugins

nevernotifyupdaterplugin 0.0.9
TracAccountManager 0.2.1dev-r7737
TracPHPDoc 0.11.0.1dev
TracSecureTickets 0.1.4

Python Traceback

Traceback (most recent call last):
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 513, in _dispatch_request
    dispatcher.dispatch(req)
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 235, in dispatch
    resp = chosen_handler.process_request(req)
  File "build/bdist.linux-i686/egg/trac/search/web_ui.py", line 96, in process_request
    results = self._do_search(req, terms, filters)
  File "build/bdist.linux-i686/egg/trac/search/web_ui.py", line 201, in _do_search
    or [])
  File "build/bdist.linux-i686/egg/phpdoctrac/phpdoctrac.py", line 207, in get_search_results
    keywords = [k.encode(self.encoding) for k in keywords]
UnicodeEncodeError: 'latin-1' codec can't encode character u'\u0159' in position 2: ordinal not in range(256)

Attachments (0)

Change History (1)

comment:1 Changed 13 years ago by pkloud@…

Resolution: fixed
Status: newclosed

Solved by setting parametr "encoding" in trac.ini for phpdoc

[phpdoc]
path = ...
encoding = utf-8

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Robert Verspuy.
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.