Opened 17 years ago
Closed 17 years ago
#7241 closed defect (fixed)
Encoding problems when exporting wiki to console
| Reported by: | anonymous | Owned by: | Christian Boos |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.11.1 |
| Component: | admin/console | Version: | 0.11rc1 |
| Severity: | normal | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description (last modified by )
Found related tickets for 0.10.* versions but problem remains in 0.11rc1. Sorry if it is a duplicate…
When executing
trac-admin $trac_env wiki export $page_name
and the page contains Portuguese characters, like an "a with a tilde", I get the following error:
Traceback (most recent call last):
File "C:\Program Files\Python25\Scripts\trac-admin-script.py", line 8, in <module>
load_entry_point('Trac==0.11rc1', 'console_scripts', 'trac-admin')()
File "c:\program files\python25\lib\site-packages\Trac-0.11rc1-py2.5-win32.egg
\trac\admin\console.py", line 1249, in run
return admin.onecmd(command)
File "c:\program files\python25\lib\site-packages\Trac-0.11rc1-py2.5-win32.egg
\trac\admin\console.py", line 104, in onecmd
rv = cmd.Cmd.onecmd(self, line) or 0
File "C:\Program Files\Python25\Lib\cmd.py", line 219, in onecmd
return func(arg)
File "c:\program files\python25\lib\site-packages\Trac-0.11rc1-py2.5-win32.egg
\trac\admin\console.py", line 686, in do_wiki
self._do_wiki_export(page, file)
File "c:\program files\python25\lib\site-packages\Trac-0.11rc1-py2.5-win32.egg
\trac\admin\console.py", line 755, in _do_wiki_export
print text
File "C:\Program Files\Python25\lib\encodings\cp437.py", line 12, in encode
return codecs.charmap_encode(input,errors,encoding_map) UnicodeEncodeError: 'charmap' codec can't encode character u'\xe3' in position 596: character maps to <undefined>
I'm running English version Windows XP SP3 with locale set to Portuguese.
Thanks, Antao
Attachments (2)
Change History (5)
comment:1 by , 17 years ago
| Description: | modified (diff) |
|---|---|
| Milestone: | → 0.11.1 |
| Owner: | changed from to |
by , 17 years ago
| Attachment: | 7241-trac-admin-wiki-export-r7376.diff added |
|---|
Convert the print statements in admin/console.py to printout ones.
comment:2 by , 17 years ago
| Status: | new → assigned |
|---|
I changed mostly all the print statements for consistency and for catching potential similar issues. I also took this opportunity to add translation markers.
Follow-up patch will do the same for the older console_print(sys.stderr, ...) statements.
The changes are simples but there are many and I may have missed a thing or two, so review and testing appreciated!
by , 17 years ago
| Attachment: | 7241-trac-admin-wiki-export-r7376.2.diff added |
|---|
Updated patch, also use printerr now
comment:3 by , 17 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |



Reproduced, should be easy to fix now using
console_print.