UnicodeDecodeError from bzr version when log file has non-ascii path
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
Low
|
Martin Packman |
Bug Description
consider the following on Windows:
c:\>set BZR_HOME=
[do some bzr stuff...]
c:\>dir %BZR_HOME%
Directory of O:\temp\test_©har
...
01/01/2009 07:57 PM 5,233 .bzr.log
c:\>bzr version
...
File "O:\src\
to_
File "o:\src\
data, consumed = self.encode(object, self.errors)
File "o:\src\
return codecs.
UnicodeDecodeError: 'ascii' codec can't decode byte 0xa9 in position 11: ordinal not in range(128)
Related branches
- Jelmer Vernooij (community): Approve
-
Diff: 64 lines (+26/-7)3 files modifiedbzrlib/tests/blackbox/test_version.py (+17/-0)
bzrlib/trace.py (+6/-7)
doc/en/release-notes/bzr-2.5.txt (+3/-0)
summary: |
- BZR_HOME with extended char causes 'bzr version' to fail + UnicodeDecodeError from bzr version when log file has non-ascii path |
Changed in bzr: | |
status: | In Progress → Won't Fix |
status: | Won't Fix → Confirmed |
Changed in bzr: | |
assignee: | nobody → Martin Packman (gz) |
status: | Confirmed → In Progress |
Changed in bzr: | |
milestone: | none → 2.5b6 |
status: | In Progress → Fix Released |
This is fixed with:
=== modified file 'bzrlib/version.py'
config_ dir = config_ dir.decode( osutils. get_user_ encoding( ))
to_file. write(" Bazaar configuration: %s\n" % (config_dir,))
to_file. write(" Bazaar log file: ") write(trace. _bzr_log_ filename + '\n') bzr_log_ filename decode( sys.getfilesyst emencoding( )) write(log_ fn + '\n')
to_file. write(' \n')
to_file. write(bzrlib. __copyright_ _ + '\n')
--- bzrlib/version.py 2008-04-02 00:14:00 +0000
+++ bzrlib/version.py 2009-01-01 09:10:31 +0000
@@ -75,7 +75,10 @@
- to_file.
+ log_fn = trace._
+ if not isinstance(log_fn, unicode):
+ log_fn = log_fn.
+ to_file.
if show_copyright: