[gedit/wip/python3] Encode the text instead of bytes conversion



commit 367c5b586d1e46105f2e862198b45be8d5013a24
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Sat Oct 27 18:55:55 2012 +0200

    Encode the text instead of bytes conversion

 plugins/externaltools/tools/capture.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/plugins/externaltools/tools/capture.py b/plugins/externaltools/tools/capture.py
index a41a96a..27ffc9b 100644
--- a/plugins/externaltools/tools/capture.py
+++ b/plugins/externaltools/tools/capture.py
@@ -116,7 +116,7 @@ class Capture(GObject.Object):
         # IO
         if self.input_text is not None:
             # Write async, in chunks of something
-            self.write_buffer = bytes(self.input_text, 'UTF-8')
+            self.write_buffer = self.input_text.encode('utf-8')
 
             if self.idle_write_chunk():
                 self.idle_write_id = GObject.idle_add(self.idle_write_chunk)
@@ -136,7 +136,7 @@ class Capture(GObject.Object):
             self.pipe.stdin.write(self.write_buffer[:m])
             
             if m == l:
-                self.write_buffer = ''
+                self.write_buffer = b''
                 self.pipe.stdin.close()
                 
                 self.idle_write_id = 0



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]