[Reportbug-commits] [reportbug] 27/32: additional fixes for py3k

Sandro Tosi morph at moszumanska.debian.org
Thu Dec 1 01:36:53 UTC 2016


This is an automated email from the git hooks/post-receive script.

morph pushed a commit to branch master
in repository reportbug.

commit 92fb6fb03e73e18ed4b8460d79ffa181092b5166
Author: Sandro Tosi <morph at debian.org>
Date:   Wed Nov 30 19:58:08 2016 -0500

    additional fixes for py3k
---
 reportbug/ui/text_ui.py | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/reportbug/ui/text_ui.py b/reportbug/ui/text_ui.py
index 2119891..950eff8 100644
--- a/reportbug/ui/text_ui.py
+++ b/reportbug/ui/text_ui.py
@@ -265,10 +265,6 @@ def get_string(prompt, options=None, title=None, empty_ok=False, force_prompt=Fa
         else:
             response = our_raw_input('> ', options, completer)
 
-    # Translate the response into a Unicode string
-    if response is not None and not isinstance(response, str):
-        response = str(response, charset, 'replace')
-
     return response
 
 
@@ -1027,7 +1023,7 @@ def spawn_editor(message, filename, editor, charset='utf-8'):
 
     # Move the cursor for lazy buggers like me; add your editor here...
     ourline = 0
-    for (lineno, line) in enumerate(file(filename)):
+    for (lineno, line) in enumerate(open(filename)):
         if line == '\n' and not ourline:
             ourline = lineno + 2
 
@@ -1065,7 +1061,7 @@ def spawn_editor(message, filename, editor, charset='utf-8'):
     if '&' in editor:
         return (None, 1)
 
-    newmessage = file(filename).read().decode(charset, 'replace')
+    newmessage = open(filename).read()
 
     if newmessage == message:
         ewrite('No changes were made in the editor.\n')

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reportbug/reportbug.git



More information about the Reportbug-commits mailing list