File: 0002-test.py-decode-cont-before-writing-it-to-stdout.patch

package info (click to toggle)
python-editor 1.0.3-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 120 kB
  • sloc: python: 301; makefile: 15
file content (21 lines) | stat: -rw-r--r-- 604 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
From: David Rabel <david.rabel@noresoft.com>
Date: Tue, 4 Sep 2018 12:01:31 +0200
Subject: test.py: decode cont before writing it to stdout
Forwarded: https://github.com/fmoo/python-editor/pull/22

Fixed python3 error:
TypeError: write() argument must be str, not bytes
---
 test.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test.py b/test.py
index 73b7cea..3abcce4 100644
--- a/test.py
+++ b/test.py
@@ -3,4 +3,4 @@ import editor
 
 cont = editor.edit(contents='ABC!',
                    use_tty='use_tty' in sys.argv)
-sys.stdout.write(cont)
+sys.stdout.write(cont.decode())