This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jason.briggs
Recipients jason.briggs
Date 2013-02-20.11:45:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1361360729.12.0.267865826707.issue17253@psf.upfronthosting.co.za>
In-reply-to
Content
The sys.stdin.readline function takes a limit parameter, which limits the number of characters read. If you try using that parameter in IDLE, you get the following error:

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    sys.stdin.readline(13)
TypeError: readline() takes exactly 1 positional argument (2 given)

I've tried this in a number of different versions and it looks to have been like this for a while. A possible fix looks fairly straightforward. Something vaguely like...

<     def readline(self):
---
>     def readline(self, limit=-1):
993a994,995
>         if limit >= 0:
>             line = line[0:limit]

(with apologies if this is a dup ticket -- there seems to be a number of tickets raised regarding issues with IDLE and its version stdin/stdout, but I couldn't see any which discussed this particular behaviour).
History
Date User Action Args
2013-02-20 11:45:29jason.briggssetrecipients: + jason.briggs
2013-02-20 11:45:29jason.briggssetmessageid: <1361360729.12.0.267865826707.issue17253@psf.upfronthosting.co.za>
2013-02-20 11:45:29jason.briggslinkissue17253 messages
2013-02-20 11:45:28jason.briggscreate