Modify

Opened 6 years ago

Closed 5 years ago

Last modified 17 months ago

#4213 closed defect (duplicate)

Wiki pages with not ASCII-names

Reported by: johnny@… Owned by: athomas
Priority: normal Component: TagsPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

I have wiki page with not ASCII name - for example "Архитектура".
I set tag for this page, go to "Tags" and click on this tag.
I receive error report

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

How to Reproduce

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

Request parameters:

{'q': u"'notComplited'"}

User Agent was: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4

System Information

Trac 0.11
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)]
setuptools 0.6c7
SQLite 3.3.4
pysqlite 2.3.2
Genshi 0.5
Pygments 0.10
Subversion 1.5.0 (r31699)
jQuery: 1.2.3

Python Traceback

Traceback (most recent call last):
  File "D:\Work\contr\__tools\Python\lib\site-packages\trac-0.11-py2.5.egg\trac\web\main.py", line 423, in _dispatch_request
    dispatcher.dispatch(req)
  File "D:\Work\contr\__tools\Python\lib\site-packages\trac-0.11-py2.5.egg\trac\web\main.py", line 197, in dispatch
    resp = chosen_handler.process_request(req)
  File "build\bdist.win32\egg\tractags\web_ui.py", line 99, in process_request
    data['tag_body'] =  macro.expand_macro(formatter, None, query)
  File "build\bdist.win32\egg\tractags\macros.py", line 79, in expand_macro
    key=lambda r: str(r[0].id)):
  File "build\bdist.win32\egg\tractags\macros.py", line 80, in <lambda>
    key=lambda r: str(r[0].id)):
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-10: ordinal not in range(128)


================
To fix this bag:

tractags\macros.py, line 80

OLD: for resource, tags in sorted(query_result,

key=lambda r: str(r[0].id)):

NEW: for resource, tags in sorted(query_result,

key=lambda r: unicode(r[0].id)):

Attachments (0)

Change History (1)

comment:1 Changed 5 years ago by osimons

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

Duplicate. See #2493. Upgrade to latest tags trunk.

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 athomas. 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.