mirror of https://github.com/python/cpython.git
Enable basic load/store again.
This commit is contained in:
parent
caf871ad32
commit
4d9ed9fc33
|
@ -123,6 +123,8 @@ def coding_spec(str):
|
||||||
|
|
||||||
Raise LookupError if the encoding is declared but unknown.
|
Raise LookupError if the encoding is declared but unknown.
|
||||||
"""
|
"""
|
||||||
|
# perform string manipulation in latin-1
|
||||||
|
str = str.decode("latin-1")
|
||||||
# Only consider the first two lines
|
# Only consider the first two lines
|
||||||
str = str.split("\n")[:2]
|
str = str.split("\n")[:2]
|
||||||
str = "\n".join(str)
|
str = "\n".join(str)
|
||||||
|
@ -386,7 +388,7 @@ def writefile(self, filename):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def encode(self, chars):
|
def encode(self, chars):
|
||||||
if isinstance(chars, types.StringType):
|
if isinstance(chars, bytes):
|
||||||
# This is either plain ASCII, or Tk was returning mixed-encoding
|
# This is either plain ASCII, or Tk was returning mixed-encoding
|
||||||
# text to us. Don't try to guess further.
|
# text to us. Don't try to guess further.
|
||||||
return chars
|
return chars
|
||||||
|
@ -544,8 +546,6 @@ def asksavefile(self):
|
||||||
self.savedialog = tkFileDialog.SaveAs(master=self.text,
|
self.savedialog = tkFileDialog.SaveAs(master=self.text,
|
||||||
filetypes=self.filetypes)
|
filetypes=self.filetypes)
|
||||||
filename = self.savedialog.show(initialdir=dir, initialfile=base)
|
filename = self.savedialog.show(initialdir=dir, initialfile=base)
|
||||||
if isinstance(filename, str):
|
|
||||||
filename = filename.encode(filesystemencoding)
|
|
||||||
return filename
|
return filename
|
||||||
|
|
||||||
def updaterecentfileslist(self,filename):
|
def updaterecentfileslist(self,filename):
|
||||||
|
|
Loading…
Reference in New Issue