File: 0005-Fix-copying-of-remote-files-with-Python-3.patch

package info (click to toggle)
gedit-source-code-browser-plugin 3.0.3-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 356 kB
  • ctags: 282
  • sloc: python: 427; xml: 30; makefile: 4
file content (22 lines) | stat: -rw-r--r-- 992 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
From: Pietro Battiston <me@pietrobattiston.it>
Date: Wed, 14 May 2014 00:33:59 +0200
Subject: Fix copying of remote files with Python 3

This closes LP #1313112
---
 sourcecodebrowser/plugin.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sourcecodebrowser/plugin.py b/sourcecodebrowser/plugin.py
index 8ce04df..bb1f686 100644
--- a/sourcecodebrowser/plugin.py
+++ b/sourcecodebrowser/plugin.py
@@ -413,7 +413,7 @@ class SourceCodeBrowserPlugin(GObject.Object, Gedit.WindowActivatable, PeasGtk.C
                         contents = document.get_text(document.get_start_iter(),
                                                      document.get_end_iter(),
                                                      True)
-                        os.write(fd, contents)
+                        os.write(fd, bytes(contents, 'UTF-8'))
                         os.close(fd)
                         while Gtk.events_pending():
                             Gtk.main_iteration()