Use text rather than binary mode for editing commit messages
authorStephen Darnell <stephen@darnell.plus.com>
Thu, 04 May 2006 15:42:14 -0700
changeset 2206 c74e91e81f70
parent 2205 62df298736be
child 2207 8a2a7f7d9df6
Use text rather than binary mode for editing commit messages
mercurial/ui.py
--- a/mercurial/ui.py	Thu May 04 15:25:24 2006 -0700
+++ b/mercurial/ui.py	Thu May 04 15:42:14 2006 -0700
@@ -242,7 +242,8 @@
     def debug(self, *msg):
         if self.debugflag: self.write(*msg)
     def edit(self, text, user):
-        (fd, name) = tempfile.mkstemp(prefix="hg-editor-", suffix=".txt")
+        (fd, name) = tempfile.mkstemp(prefix="hg-editor-", suffix=".txt",
+                                      text=True)
         try:
             f = os.fdopen(fd, "w")
             f.write(text)