Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idle - Save (buffer) - closes IDLE and does not save file (Windows XP) #45471

Closed
infixum mannequin opened this issue Sep 8, 2007 · 4 comments
Closed

Idle - Save (buffer) - closes IDLE and does not save file (Windows XP) #45471

infixum mannequin opened this issue Sep 8, 2007 · 4 comments
Assignees
Labels
topic-IDLE type-bug An unexpected behavior, bug, or error

Comments

@infixum
Copy link
Mannequin

infixum mannequin commented Sep 8, 2007

BPO 1130
Nosy @kbkaiser, @taleinat

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/kbkaiser'
closed_at = <Date 2007-10-09.23:13:37.668>
created_at = <Date 2007-09-08.02:27:20.283>
labels = ['expert-IDLE', 'type-bug']
title = 'Idle - Save (buffer) - closes IDLE and does not save file (Windows XP)'
updated_at = <Date 2008-01-06.22:29:45.601>
user = 'https://bugs.python.org/infixum'

bugs.python.org fields:

activity = <Date 2008-01-06.22:29:45.601>
actor = 'admin'
assignee = 'kbk'
closed = True
closed_date = <Date 2007-10-09.23:13:37.668>
closer = 'kbk'
components = ['IDLE']
creation = <Date 2007-09-08.02:27:20.283>
creator = 'infixum'
dependencies = []
files = []
hgrepos = []
issue_num = 1130
keywords = []
message_count = 4.0
messages = ['56096', '56296', '56301', '56433']
nosy_count = 2.0
nosy_names = ['kbk', 'taleinat']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue1130'
versions = ['Python 3.0']

@infixum infixum mannequin added topic-IDLE type-bug An unexpected behavior, bug, or error labels Sep 8, 2007
@infixum infixum mannequin changed the title Idle - Save (buffer) Idle - Save (buffer) - closes IDLE and does not save file (Windows XP) Sep 8, 2007
@kbkaiser kbkaiser self-assigned this Sep 11, 2007
@taleinat
Copy link
Contributor

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'))

@kbkaiser
Copy link
Contributor

kbkaiser commented Oct 9, 2007

r58398. Thanks for the report.

Solution a little different than Tal Einat's. Please test.

@kbkaiser kbkaiser closed this as completed Oct 9, 2007
@taleinat
Copy link
Contributor

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...)

@kbkaiser
Copy link
Contributor

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.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-IDLE type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants