summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/idlelib/IOBinding.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/idlelib/IOBinding.py b/Lib/idlelib/IOBinding.py
index 3e1f87d..0c3ae7f 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")