[Python-3000-checkins] r58398 - python/branches/py3k/Lib/idlelib/IOBinding.py python/branches/py3k/Lib/idlelib/NEWS.txt

kurt.kaiser python-3000-checkins at python.org
Wed Oct 10 01:12:31 CEST 2007


Author: kurt.kaiser
Date: Wed Oct 10 01:12:31 2007
New Revision: 58398

Modified:
   python/branches/py3k/Lib/idlelib/IOBinding.py
   python/branches/py3k/Lib/idlelib/NEWS.txt
Log:
Windows EOL sequence not converted correctly, encoding error.
Caused file save to fail. Bug 1130.

M    idlelib/IOBinding.py
M    idlelib/NEWS.txt


Modified: python/branches/py3k/Lib/idlelib/IOBinding.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/IOBinding.py	(original)
+++ python/branches/py3k/Lib/idlelib/IOBinding.py	Wed Oct 10 01:12:31 2007
@@ -242,7 +242,6 @@
 
     eol = r"(\r\n)|\n|\r"  # \r\n (Windows), \n (UNIX), or \r (Mac)
     eol_re = re.compile(eol)
-    eol_convention = os.linesep # Default
 
     def loadfile(self, filename):
         try:
@@ -389,9 +388,10 @@
 
     def writefile(self, filename):
         self.fixlastline()
-        chars = self.encode(self.text.get("1.0", "end-1c"))
+        text = self.text.get("1.0", "end-1c")
         if self.eol_convention != "\n":
-            chars = chars.replace("\n", self.eol_convention)
+            text = text.replace("\n", self.eol_convention)
+        chars = self.encode(self.text.get("1.0", "end-1c"))
         try:
             f = open(filename, "wb")
             f.write(chars)

Modified: python/branches/py3k/Lib/idlelib/NEWS.txt
==============================================================================
--- python/branches/py3k/Lib/idlelib/NEWS.txt	(original)
+++ python/branches/py3k/Lib/idlelib/NEWS.txt	Wed Oct 10 01:12:31 2007
@@ -1,3 +1,12 @@
+What's New in IDLE 3.0a2?
+=========================
+
+*Release date: XX-XXX-2007*
+
+- Windows EOL sequence not converted correctly, encoding error.
+  Caused file save to fail. Bug 1130.
+
+
 What's New in IDLE 3.0a1?
 =========================
 
@@ -19,7 +28,7 @@
 What's New in IDLE 2.6a1?
 =========================
 
-*Release date: XX-XXX-200X*  UNRELEASED
+*Release date: XX-XXX-200X*  UNRELEASED, but merged into 3.0a1
 
 - Corrected some bugs in AutoComplete.  Also, Page Up/Down in ACW implemented;
   mouse and cursor selection in ACWindow implemented; double Tab inserts


More information about the Python-3000-checkins mailing list