Edgewall Software
Modify

Opened 15 years ago

Last modified 15 months ago

#8829 new defect

[Patch] Make Trac work on all platforms with environment paths containing non-ASCII characters

Reported by: mikael@… Owned by:
Priority: low Milestone: next-stable-1.6.x
Component: admin/console Version: 0.12dev
Severity: major Keywords: environment path unicode patch
Cc: Thijs Triemstra Branch:
Release Notes:
API Changes:
Internal Changes:

Description

(This is my very first ticket here, I have scanned for duplicates, to the best of my knowledge, but found none.)

My account name is "Administratör" in WinXP, and the following happens when using trac-admin to upgrade wiki in my environment:

trac-admin abc wiki upgrade
  CamelCase already up to date.
  InterMapTxt already exists.
  InterTrac already up to date.
  InterWiki already up to date.
  PageTemplates already up to date.
  RecentChanges already up to date.
UnicodeDecodeError: ('ascii', 'C:\\Documents and Settings\\Administrat\xf6r\\App
lication Data\\Python-Eggs\\trac-0.12dev_r8812-py2.6.egg-tmp\\trac\\wiki\\defaul
t-pages\\SandBox', 37, 38, 'ordinal not in range(128)')

trac-admin seems to be choking on the ö letter.

Attachments (1)

unicode-path-8829.patch (616 bytes ) - added by Thijs Triemstra 14 years ago.
against 0.13 trunk r10664

Download all attachments as: .zip

Change History (20)

comment:1 by Christian Boos, 15 years ago

Keywords: environment path unicode added
Milestone: 1.0
Priority: normallow

You're right, I also think there's no ticket about this.

Making Trac work on all platforms with environment paths containing non-ascii characters is something non-trivial.

comment:2 by Christian Boos, 15 years ago

Milestone: 1.0unscheduled

Milestone 1.0 deleted

comment:3 by Thijs Triemstra <lists@…>, 14 years ago

Cc: lists@… added

Not sure why this was lowered in priority, since it breaks trac upgrades..?

comment:4 by Remy Blank, 14 years ago

Because there's an easy workaround: don't put your Trac environment in a path containing non-ASCII characters.

in reply to:  4 comment:5 by Thijs Triemstra <lists@…>, 14 years ago

Replying to rblank:

Because there's an easy workaround: don't put your Trac environment in a path containing non-ASCII characters.

Is this documented?

comment:6 by Christian Boos, 14 years ago

Yes, under TracEnvironment#SomeUsefulTips. One could also add a word about this below TracInstall#CreatingaProjectEnvironment.

comment:7 by Mikael Relbe, 14 years ago

I added a word about it below TracInstall@323#CreatingaProjectEnvironment.

in reply to:  7 comment:8 by Thijs Triemstra <lists@…>, 14 years ago

Severity: normalmajor

Replying to mrelbe:

I added a word about it below TracInstall@323#CreatingaProjectEnvironment.

Thanks. I guess raising it's severity is appropriate as well.

comment:9 by Thijs Triemstra, 14 years ago

Cc: Thijs Triemstra added; lists@… removed

Looks like there's actually a warning issued already:

 try:
     unicode(env_path, 'ascii')
 except UnicodeDecodeError:
     printerr(_("Non-ascii environment path '%(path)s' not "
                       "supported.", path=env_path))
     sys.exit(2)

comment:10 by Thijs Triemstra, 14 years ago

Summary: trac-admin wiki upgrade fails when user account contains unicode charstrac-admin wiki upgrade fails when environment name contains unicode chars

comment:11 by Thijs Triemstra, 14 years ago

Summary: trac-admin wiki upgrade fails when environment name contains unicode charstrac-admin wiki upgrade fails when environment path contains unicode chars

in reply to:  9 comment:12 by Thijs Triemstra, 14 years ago

Keywords: patch added
Milestone: unscheduled0.13
Summary: trac-admin wiki upgrade fails when environment path contains unicode chars[PATCH] trac-admin wiki upgrade fails when environment path contains unicode chars

Replying to thijstriemstra:

Looks like there's actually a warning issued already:

 try:
     unicode(env_path, 'ascii')
 except UnicodeDecodeError:
     printerr(_("Non-ascii environment path '%(path)s' not "
                       "supported.", path=env_path))
     sys.exit(2)

But this error fails to print, and throws:

$ trac-admin test-trac-Administratör upgrade wiki
Traceback (most recent call last):
  File "/usr/local/bin/trac-admin", line 9, in <module>
    load_entry_point('Trac==0.13dev-r10664', 'console_scripts', 'trac-admin')()
  File "/home/thijs/workspaces/opensource/trac-trunk/trac/admin/console.py", line 546, in run
    "supported.", path=env_path))
  File "/home/thijs/workspaces/opensource/trac-trunk/trac/util/translation.py", line 197, in gettext
    return _gettext()
  File "/home/thijs/workspaces/opensource/trac-trunk/trac/util/translation.py", line 194, in _gettext
    return safefmt(self.active.ugettext(string), kwargs)
  File "/home/thijs/workspaces/opensource/trac-trunk/trac/util/translation.py", line 33, in safefmt
    return string % kwargs
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 55: ordinal not in range(128)

Attached patch fixes that for me so the user at least knows what went wrong:

$ trac-admin test-trac-Administratör upgrade wiki
Non-ascii environment path '/home/thijs/workspaces/opensource/test-trac-Administratör' not supported.

by Thijs Triemstra, 14 years ago

Attachment: unicode-path-8829.patch added

against 0.13 trunk r10664

comment:13 by Remy Blank, 14 years ago

unicode-path-8829.patch applied on 0.12-stable in [10683], thanks. I'm leaving this open for fixing the original issue.

in reply to:  13 comment:14 by Thijs Triemstra, 14 years ago

Summary: [PATCH] trac-admin wiki upgrade fails when environment path contains unicode charsMake Trac work on all platforms with environment paths containing non-ascii characters

Replying to rblank:

I'm leaving this open for fixing the original issue.

I'm renaming the ticket in that case.

comment:15 by Remy Blank, 12 years ago

Milestone: 1.01.0-triage

Preparing for 1.0.

comment:16 by figaro, 9 years ago

Summary: Make Trac work on all platforms with environment paths containing non-ascii characters[Patch] Make Trac work on all platforms with environment paths containing non-ASCII characters

comment:17 by Ryan J Ollos, 8 years ago

Milestone: next-stable-1.0.xnext-stable-1.2.x

Moved ticket assigned to next-stable-1.0.x since maintenance of 1.0.x is coming to a close. Please move the ticket back if it's critical to fix on 1.0.x.

comment:18 by Ryan J Ollos, 5 years ago

Milestone: next-stable-1.2.xnext-stable-1.4.x

comment:19 by Ryan J Ollos, 15 months ago

Milestone: next-stable-1.4.xnext-stable-1.6.x

Milestone renamed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


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