Make sure eol_convention is an ASCII string. Fixes #774680.

Will backport to 2.3.
This commit is contained in:
Martin v. Löwis 2003-08-05 05:51:20 +00:00
parent 5d9c636faf
commit 249d50a25f
1 changed files with 3 additions and 0 deletions

View File

@ -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")