classification
Title: Idle - Save (buffer) - closes IDLE and does not save file (Windows XP)
Type: behavior Stage:
Components: IDLE Versions: Python 3.0
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: kbk Nosy List: kbk, taleinat
Priority: normal Keywords:

Created on 2007-09-08 02:27 by infixum, last changed 2008-01-06 22:29 by admin. This issue is now closed.

Messages (4)
msg56096 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2007-09-23 16:56
The saving bug is a string/bytes issue, simply fixed by replaced line
366 in Lib\idlelib\IOBinding.py with:
chars = chars.replace(b"\n", self.eol_convention.encode('ASCII'))
msg56296 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2007-10-09 23:13
r58398.  Thanks for the report.

Solution a little different than Tal Einat's.  Please test.
msg56301 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2007-10-10 00:17
Your solution is better than my suggestion, but has two minor bugs:

1) eol_convention must be initialized somewhere. For instance, opening a
new editor window (Ctrl+N) and saving it fails because
self.eol_convention is not defined. I agree that is shouldn't be a class
attribute, but it must be intialized in __init__.

2) You meant chars = self.encode(text), right? (otherwise the eol change
is discraded...)
msg56433 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2007-10-15 03:19
I caught the first part, but not the second using GNU/Linux.

I think that eol_convention can be a class variable,
since os.linesep isn't going to change from file to file.
Thanks for the report!
r58465.
History
Date User Action Args
2008-01-06 22:29:45adminsetkeywords: - py3k
versions: Python 3.0
2007-10-15 03:19:28kbksetmessages: + msg56433
2007-10-10 00:17:22taleinatsetmessages: + msg56301
2007-10-09 23:13:37kbksetstatus: open -> closed
resolution: fixed
messages: + msg56296
2007-09-23 16:56:03taleinatsetnosy: + taleinat
messages: + msg56096
2007-09-17 10:49:58jafosetpriority: normal
2007-09-11 19:15:21kbksetkeywords: + py3k
assignee: kbk
nosy: + kbk
2007-09-08 02:29:45infixumsettitle: Idle - Save (buffer) -> Idle - Save (buffer) - closes IDLE and does not save file (Windows XP)
2007-09-08 02:27:20infixumcreate