Modify ↓
Opened 17 years ago
Closed 17 years ago
#369 closed defect (fixed)
UnicodeEncodeError while storing build log messages in files
| Reported by: | Felix Schwarz <felix.schwarz@…> | Owned by: | dfraser |
|---|---|---|---|
| Priority: | critical | Milestone: | 0.6 |
| Component: | Build master | Version: | dev |
| Keywords: | Cc: | ||
| Operating System: | Linux |
Description
When I updated bitten to r591, experienced a Unicode Decode Error?:
Add filename column to log table to save where log files are stored.
Done.
Migrates logs that are stored in the bitten_log_messages table into files.
Traceback (most recent call last):
File "/usr/bin/trac-admin", line 7, in ?
sys.exit(
File "/usr/lib/python2.4/site-packages/Trac-0.11stable_r7938-py2.4.egg/trac/admin/console.py", line 1317, in run
return admin.onecmd(command)
File "/usr/lib/python2.4/site-packages/Trac-0.11stable_r7938-py2.4.egg/trac/admin/console.py", line 133, in onecmd
rv = cmd.Cmd.onecmd(self, line) or 0
File "/usr/lib/python2.4/cmd.py", line 219, in onecmd
return func(arg)
File "/usr/lib/python2.4/site-packages/Trac-0.11stable_r7938-py2.4.egg/trac/admin/console.py", line 1154, in do_upgrade
self.__env.upgrade(backup=do_backup)
File "/usr/lib/python2.4/site-packages/Trac-0.11stable_r7938-py2.4.egg/trac/env.py", line 458, in upgrade
participant.upgrade_environment(db)
File "/usr/lib/python2.4/site-packages/Bitten-0.6dev_r591-py2.4.egg/bitten/main.py", line 74, in upgrade_environment
function(self.env, db)
File "/usr/lib/python2.4/site-packages/Bitten-0.6dev_r591-py2.4.egg/bitten/upgrades.py", line 327, in migrate_logs_to_files
message_file.write(message + "\n")
UnicodeEncodeError: 'ascii' codec can't encode character u'\xbb' in position 39: ordinal not in range(128)
I worked around the issue by using
to_unicode(message).encode('UTF-8')
but I'm not sure that this is the best fix.
Attachments (0)
Change History (2)
comment:1 Changed 17 years ago by dfraser
- Owner changed from cmlenz to dfraser
- Status changed from new to assigned
comment:2 Changed 17 years ago by dfraser
- Resolution set to fixed
- Status changed from assigned to closed
This should be fixed by r593, which includes tests for the normal case of uploading and reading messages as well...
Note: See
TracTickets for help on using
tickets.

Thanks, I'll look into it...