Edgewall Software

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#12560 closed defect (fixed)

UnicodeDecodeError: 'ascii' codec can't decode byte 0x9f in position 36: ordinal not in range(128)

Reported by: Lukasz Owned by: Jun Omae
Priority: normal Milestone: 1.0.13
Component: version control/browser Version: 1.1.6
Severity: normal Keywords: svn
Cc: lukasz.matecki@… Branch:
Release Notes:

Fixed UnicodeDecodeError when expanding Date in svn:keywords.

API Changes:
Internal Changes:


How to Reproduce

While doing a GET operation on /browser/tags/--PRIVATE-DATA-REMOVED---, Trac issued an internal error.

(please provide additional details here)

My observation: the file processed has a Date SVN keyword which, after substitution, expands to non-ascii string (Polish "Paź." for month name).

Request parameters:

{u'format': u'zip', 'path': u'/tags/--PRIVATE-DATA-REMOVED---', u'rev': u'1154'}

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

System Information

Trac 1.1.6
Babel 0.9.6
Genshi 0.7 (without speedups)
Pygments 1.6
pysqlite 2.6.0
Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit (Intel)]
pytz 2011c
RPC 1.1.5
setuptools 12.0.1
SQLite 3.6.21
Subversion 1.7.5 (r1336830)
jQuery 1.8.3
jQuery UI 1.9.2
jQuery Timepicker 1.1.1

Enabled Plugins

tracfilelist 0.1
tracticketreferenceplugin 0.5.0
tracxmlrpc 1.1.5

Interface Customization

site-htdocs doxygen, trac, viresco_00.jpg

Python Traceback

Traceback (most recent call last):
  File "c:\Python27\lib\site-packages\trac\web\main.py", line 587, in _dispatch_request
  File "c:\Python27\lib\site-packages\trac\web\main.py", line 246, in dispatch
    resp = chosen_handler.process_request(req)
  File "c:\Python27\lib\site-packages\trac\versioncontrol\web_ui\browser.py", line 402, in process_request
    self._render_zip(req, context, repos, node, rev)
  File "c:\Python27\lib\site-packages\trac\versioncontrol\web_ui\browser.py", line 659, in _render_zip
    render_zip(req, filename, repos, root_node, self._iter_nodes)
  File "c:\Python27\lib\site-packages\trac\versioncontrol\web_ui\util.py", line 213, in render_zip
    data = node.get_processed_content(eol_hint='CRLF').read()
  File "c:\Python27\lib\site-packages\tracopt\versioncontrol\svn\svn_fs.py", line 803, in get_processed_content
    return FileContentStream(self, keyword_substitution, eol_style)
  File "c:\Python27\lib\site-packages\tracopt\versioncontrol\svn\svn_fs.py", line 1175, in __init__
  File "c:\Python27\lib\site-packages\tracopt\versioncontrol\svn\svn_fs.py", line 1253, in _get_keyword_values
    for key, value in values.iteritems())
  File "c:\Python27\lib\site-packages\tracopt\versioncontrol\svn\svn_fs.py", line 1253, in <genexpr>
    for key, value in values.iteritems())
UnicodeDecodeError: 'ascii' codec can't decode byte 0x9f in position 36: ordinal not in range(128)

Attachments (0)

Change History (4)

comment:1 by Jun Omae, 4 years ago

Component: generalversion control/browser
Keywords: svn added
Milestone: 1.0.13
Owner: set to Jun Omae
Status: newassigned

Thanks for the reporting. This issue is caused by expanding %a and %b to non-utf8 bytes on Windows. I think Date in svn:keywords shouldn't be depended on locale.

comment:2 by lukasz.matecki@…, 4 years ago

Yes, me too. I'm having many problems because of that. Depending on client this gets expanded differently (in eclipse it is always English, in command line / Tortoise its Polish). It even gets expanded differently in the same language (different casing for months in Polish).

comment:3 by Jun Omae, 4 years ago

Proposed changes in [ec1622bd9/jomae.git].

Last edited 4 years ago by Jun Omae (previous) (diff)

comment:4 by Jun Omae, 4 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed in [15055] and merged in [15056-15057].

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jun Omae to the specified user.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.