From 249d50a25f0d8ad33efa0f3dbd45eec06e7dcdf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Tue, 5 Aug 2003 05:51:20 +0000 Subject: [PATCH] Make sure eol_convention is an ASCII string. Fixes #774680. Will backport to 2.3. --- Lib/idlelib/IOBinding.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/idlelib/IOBinding.py b/Lib/idlelib/IOBinding.py index 3e1f87dadf6..0c3ae7f85e1 100644 --- a/Lib/idlelib/IOBinding.py +++ b/Lib/idlelib/IOBinding.py @@ -252,6 +252,9 @@ class IOBinding: firsteol = self.eol_re.search(chars) if firsteol: self.eol_convention = firsteol.group(0) + if isinstance(self.eol_convention, unicode): + # Make sure it is an ASCII string + self.eol_convention = self.eol_convention.encode("ascii") chars = self.eol_re.sub(r"\n", chars) self.text.delete("1.0", "end")