Opened 17 years ago
Closed 17 years ago
#5750 closed defect (worksforme)
trac-admin upgrade chokes on unicode in .ini file
Reported by: | Owned by: | Jonas Borgström | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | general | Version: | devel |
Severity: | normal | Keywords: | needinfo |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
I set the project.name option in trac.ini to something containing LATIN SMALL LETTER U WITH DIAERESIS (ü) and got this upon trac-admin upgrade
:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)
It went away when I changed the character to plain u.
My .ini file starts with
# -*- coding: utf-8 -*-
and is saved in utf-8 encoding.
Attachments (0)
Change History (9)
comment:1 by , 17 years ago
follow-up: 4 comment:3 by , 17 years ago
Keywords: | needinfo added |
---|
Simply putting an (ü) in the project.name option in trac.ini (encoded as utf-8 of course) works for me.
Since there's normally no need for an upgrade for doing that kind of change, I suspect you're using this setting in an EnvironmentSetupParticipant
component? If so, how?
If this is something else, then I think we need to get a backtrace…
follow-up: 5 comment:4 by , 17 years ago
Replying to cboos:
Simply putting an (ü) in the project.name option in trac.ini (encoded as utf-8 of course) works for me.
Since there's normally no need for an upgrade for doing that kind of change, I suspect you're using this setting in an
EnvironmentSetupParticipant
component? If so, how?
The TimingAndEstimationPlugin I just installed does some EnvironmentSetupParticipant stuff. You might look at that. I don't know how "doing that kind of change" relates to me; I didn't change project.name
; I just did a trac-admin upgrade
for other reasons (well, Trac told me to ;-) ). And I don't think TimingAndEstimationPlugin actually uses this setting explicitly. You might look into the new Trac configuration code that only stores the differences from the default.
Also, if you want backtraces from trac-admin
it might be a good idea to disable whatever try/except block is suppressing them ;-), because I don't get one.
follow-up: 6 comment:5 by , 17 years ago
Replying to Dave Abrahams <dave@boost-consulting.com>:
The TimingAndEstimationPlugin I just installed does some EnvironmentSetupParticipant stuff. You might look at that.
I had a quick look, nothing relevant there (afaict). Puzzling.
You might look into the new Trac configuration code that only stores the differences from the default.
You mean r3744?
Also, if you want backtraces from
trac-admin
it might be a good idea to disable whatever try/except block is suppressing them ;-), because I don't get one.
Can you please try to reproduce the upgrade failure with:
Index: trac/admin/console.py =================================================================== --- trac/admin/console.py (revision 5857) +++ trac/admin/console.py (working copy) @@ -1098,6 +1098,9 @@ "upgrade without doing a backup." % msg) else: raise + except Exception: + traceback.print_exc() + raise print 'Upgrade done.' _help_hotcopy = [('hotcopy <backupdir>',
follow-up: 7 comment:6 by , 17 years ago
Replying to cboos:
Replying to Dave Abrahams <dave@boost-consulting.com>:
The TimingAndEstimationPlugin I just installed does some EnvironmentSetupParticipant stuff. You might look at that.
I had a quick look, nothing relevant there (afaict). Puzzling.
It does try to upgrade the config files. Note that I'm using the 0.11 code.
You might look into the new Trac configuration code that only stores the differences from the default.
You mean r3744?
No, I meant browser:trunk/trac/config.py:r3744#L144
Also, if you want backtraces from
trac-admin
it might be a good idea to disable whatever try/except block is suppressing them ;-), because I don't get one.Can you please try to reproduce the upgrade failure
I'm almost 100% sure that won't show anything, since I managed to successfully upgrade after changing that character in project.name
… it seems unlikely that it will try to do anything if I try again.
However; I'll confess to having commented out that except block in trac-admin (why do people eat exceptions like that? it just inhibits debugging) when I was trying to debug the problem myself. I'm pretty sure it was on the last line of timingandestimationplugin.api.do_ticket_field_upgrade
, which does a .save()
on the environment.
comment:7 by , 17 years ago
Replying to Dave Abrahams <dave@boost-consulting.com>:
No, I meant browser:trunk/trac/config.py:r3744#L144
Err, make that browser:trunk/trac/config.py:r3744#L150
comment:9 by , 17 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Assuming this works now. If not, please reopen (with a summary of theremaining problem).
Not sure to understand what you were expecting / expect:
trac.ini
file should be encoded in utf-8, as documented in the first line of the file.Can you elaborate?