Modify

Opened 2 years ago

Closed 2 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: exarv
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 2 years ago by pkloud@…

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

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

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

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from exarv. Next status will be '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.