Ticket #2912 (closed defect: fixed)
trunk unicode merge breaks admin script
| Reported by: | Andres Salomon <dilinger@…> | Owned by: | cmlenz |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.10 |
| Component: | admin/console | Version: | devel |
| Severity: | normal | Keywords: | unicode |
| Cc: |
Description
Hi,
The unicode merge broke Trac with python2.3, due to a bug in python2.3's locale module. This shows up as:
ilinger@lith:~/trac-db-testing$ sudo trac-admin /usr/local/foo Welcome to trac-admin 0.10dev Interactive Trac administration console. Copyright (c) 2003-2006 Edgewall Software
Type: '?' or 'help' for help on commands.
Trac /usr/local/foo> component list
Command failed: unknown encoding: en_gb
locale.getdefaultlocale() reads the LANGUAGE variable incorrect, and returns a value that the encode() method does not understand. This also causes the unit tests to fail. Instead of working around the bug, a better solution is to call locale.getpreferredencoding() (all we care about is the encoding anyways), since it is not broken in python2.3.


