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

curses.textpad loses characters at the end of lines #46984

Closed
shish mannequin opened this issue May 1, 2008 · 4 comments
Closed

curses.textpad loses characters at the end of lines #46984

shish mannequin opened this issue May 1, 2008 · 4 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@shish
Copy link
Mannequin

shish mannequin commented May 1, 2008

BPO 2732
Nosy @akuchling

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/akuchling'
closed_at = <Date 2008-06-22.13:56:10.671>
created_at = <Date 2008-05-01.16:39:39.992>
labels = ['type-bug', 'library']
title = 'curses.textpad loses characters at the end of lines'
updated_at = <Date 2008-06-22.13:56:10.632>
user = 'https://bugs.python.org/shish'

bugs.python.org fields:

activity = <Date 2008-06-22.13:56:10.632>
actor = 'akuchling'
assignee = 'akuchling'
closed = True
closed_date = <Date 2008-06-22.13:56:10.671>
closer = 'akuchling'
components = ['Library (Lib)']
creation = <Date 2008-05-01.16:39:39.992>
creator = 'shish'
dependencies = []
files = []
hgrepos = []
issue_num = 2732
keywords = []
message_count = 4.0
messages = ['66035', '66292', '68503', '68564']
nosy_count = 3.0
nosy_names = ['akuchling', 'elachuni', 'shish']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue2732'
versions = ['Python 2.5', 'Python 2.4']

@shish
Copy link
Mannequin Author

shish mannequin commented May 1, 2008

Even in the self-test suite, the bug appears, run:

python /usr/lib/python2.4/curses/textpad.py

then type so that the line wraps, eg 123456789123456789 to fill two
lines, and then ctrl-g to return -- the result has had the end
characters of each line removed, so the return value is
12345678\n12345678\n

As a quick hack on my local install I changed line 56 from:

last = min(self.maxx, last+1)

to

last = min(self.maxx, last)+1

and it seems to work, but I have no idea if this is the right way to
fix it (ie, this might have side effects, or this off-by-one might
happen in several places and need a global fix, not just one local one)

@shish shish mannequin added extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error labels May 1, 2008
@shish
Copy link
Mannequin Author

shish mannequin commented May 5, 2008

Also present in 2.5

@shish shish mannequin added stdlib Python modules in the Lib dir and removed extension-modules C modules in the Modules dir labels May 5, 2008
@elachuni
Copy link
Mannequin

elachuni mannequin commented Jun 21, 2008

This doesn't happen to me with 2.6 compiled from HEAD, or with 2.5.2
shipped with Ubuntu Hardy.

In both cases the output is:

Contents of text box: '123456789\n123456789\n'

@akuchling
Copy link
Member

This bug was fixed in 2.5 and 2.6, in rev. 60118 and 60119. Thanks for
your bug report!

@akuchling akuchling self-assigned this Jun 22, 2008
@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
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant