Message182488
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). |
|
Date |
User |
Action |
Args |
2013-02-20 11:45:29 | jason.briggs | set | recipients:
+ jason.briggs |
2013-02-20 11:45:29 | jason.briggs | set | messageid: <1361360729.12.0.267865826707.issue17253@psf.upfronthosting.co.za> |
2013-02-20 11:45:29 | jason.briggs | link | issue17253 messages |
2013-02-20 11:45:28 | jason.briggs | create | |
|