[issue1667] license() does not process keyboard input correctly

2012-07-03 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7ccc2cea6969 by Jesus Cea in branch '2.7': Issue #1667: Unused variable warning in Non-Windows http://hg.python.org/cpython/rev/7ccc2cea6969 -- nosy: +python-dev ___ Python tracker

[issue1667] license() does not process keyboard input correctly

2007-12-20 Thread Joseph Armbruster
Joseph Armbruster added the comment: Looks good :-) Python 3.0a2 (py3k:59579M, Dec 20 2007, 08:46:46) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> license() A. HISTORY OF THE SOFTWARE == Python was create

[issue1667] license() does not process keyboard input correctly

2007-12-20 Thread Guido van Rossum
Guido van Rossum added the comment: Ah d'oh! The 3.0 code was wrong. I've fixed it now in SVN by going back to input() Committed revision 59583. __ Tracker <[EMAIL PROTECTED]> __ ___

[issue1667] license() does not process keyboard input correctly

2007-12-20 Thread Joseph Armbruster
Joseph Armbruster added the comment: Ok, just did as so: sys.stdout.write(prompt) sys.stdout.flush() key = sys.stdin.readline() print(repr(key)) print(len(key)) if key not in ('', 'q'): Results: All Python releases are Open Source (see http://www.opensource.org for Hit Return for more, or q (a

[issue1667] license() does not process keyboard input correctly

2007-12-20 Thread Guido van Rossum
Guido van Rossum added the comment: > >>> import sys > >>> x = input() > Hi: > >>> repr(x) > "'Hi:'" > >>> x = sys.stdin.readline() > Hi: > >>> repr(x) > "'Hi:\\n'" Hm, that works as expected (except I meant "Hi:" to be the prompt, but that's okay :-). Why doesn't it inside license()? Can you pu

[issue1667] license() does not process keyboard input correctly

2007-12-20 Thread Joseph Armbruster
Joseph Armbruster added the comment: >>> import sys >>> x = input() Hi: >>> repr(x) "'Hi:'" >>> x = sys.stdin.readline() Hi: >>> repr(x) "'Hi:\\n'" __ Tracker <[EMAIL PROTECTED]> __ ___

[issue1667] license() does not process keyboard input correctly

2007-12-20 Thread Guido van Rossum
Guido van Rossum added the comment: > >>> len(x) Please print repr(x). That should be safe even if it contains control characters. __ Tracker <[EMAIL PROTECTED]> __ ___

[issue1667] license() does not process keyboard input correctly

2007-12-20 Thread Joseph Armbruster
Joseph Armbruster added the comment: Here's the results, i'll look into it briefly. >>> import sys >>> x = input() Hi: >>> len(x) 3 >>> x = sys.stdin.readline() Hi: >>> len(x) 4 __ Tracker <[EMAIL PROTECTED]> ___

[issue1667] license() does not process keyboard input correctly

2007-12-20 Thread Guido van Rossum
Guido van Rossum added the comment: Very odd. Can you experiment with input() and sys.stdin.readline() to see what exactly gets returned? It seems that somehow the CRLF -> LF translation isn't working, and that should be fixed somewhere else, not in license(). I imagine you could just do this:

[issue1667] license() does not process keyboard input correctly

2007-12-20 Thread Joseph Armbruster
Joseph Armbruster added the comment: Here are two examples of why I created this issue: example 1: that is the output I received when pressing Return 5 times using license() python Python 3.0a2 (py3k:59579M, Dec 20 2007, 08:46:46) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "

[issue1667] license() does not process keyboard input correctly

2007-12-20 Thread Guido van Rossum
Guido van Rossum added the comment: I think you misunderstand raw_input(). It just returns sys.stdin.readline().rstrip("\n"). I don't think it's worth fixing. The 'q' processing works fine as long as you didn't type \r first. :-) -- nosy: +gvanrossum resolution: -> wont fix status: o

[issue1667] license() does not process keyboard input correctly

2007-12-19 Thread Joseph Armbruster
New submission from Joseph Armbruster: url: http://svn.python.org/projects/python/branches/py3k rev: 59577 The license() function does not appear to process keyboard input correctly. Symptoms: - Carriage returns do not move license pages downwards - q option did not quit Patch to site.py attac