[With patch] Commit and log commands: encodings problems
Bug #5041 reported by
Alexander Belchenko
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
High
|
John A Meinel |
Bug Description
1) Bug in log commands: bzr use bzrlib.
2) Bug in commit command: bzr not decode message from external editor to unicode. As result this message stored "as is" with ampersand coding.
Proposed patch to fix this bugs here: http://
Changed in bzr: | |
status: | Unconfirmed → Confirmed |
To post a comment you must log in.
I find the following patch to be a simpler solution to the *second* problem. Maybe ``edit_ commit_ message( )`` (and not ``cmd_commit. run()`` ) is the right place to do the conversion to Unicode, since the editor may leave additional tips on the encoding of the file (like Emacs' ``-*- coding: xxx -*-``). Maybe ``edit_ commit_ message( )`` should also get the ``input_encoding`` option, I don't know.
----
--- msgeditor.py.orig 2005-12-06 13:49:06.645099016 +0100
+++ msgeditor.py 2005-12-06 13:57:15.331807344 +0100
@@ -20,8 +20,10 @@
"""Commit message editor support."""
import os
+import codecs
from subprocess import call
+import bzrlib
import bzrlib.config as config
from bzrlib.errors import BzrError
@@ -95,7 +97,7 @@ open(msgfilenam e, 'rt', bzrlib. user_encoding) :
stripped_ line = line.strip()
started = False
msg = []
lastline, nlines = 0, 0
- for line in file(msgfilename, "r"):
+ for line in codecs.
# strip empty line before the log message starts
if not started: