mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
Make sure eol_convention is an ASCII string. Fixes #774680.
Will backport to 2.3.
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user