Skip to content

sys command results in error #955

Closed
Closed

Description

@thevibingcat

when i enter the following code, this happens:

>>> v = sys.stdin.readline()
here is some text
>>> print(v)
here is some text
>>> v = sys.stdin.readline(13)
here is some text
[error text blah blah blah]```


what is supposed to happen is sys is supposed to save the first 13 characters (including spaces) of "here is some text".
if i do this in the actual IDLE, it does what is intended. but this does not happen in bpython. please fix this and any other commands that do not match up with the original python.
I am using Ubuntu 20.04.1, and the IDLE i mentioned is python 3.8 and bpython 0.18
Thank you.

Activity

  1. added this to the release-0.23 milestone on Mar 30, 2022
  2. sebastinas commented on Mar 30, 2022

    @sebastinas
    Contributor

    The relevant error is:

    >>> sys.stdin.readline(13)
    Traceback (most recent call last):
      File "<input>", line 1, in <module>
        v = sys.stdin.readline(13)
    TypeError: readline() takes 1 positional argument but 2 were given
  3. ulisesojeda commented on May 25, 2022

    @ulisesojeda
    Contributor

    I'll take care of it

  4. sebastinas commented on May 28, 2022

    @sebastinas
    Contributor

    This is now fixed thanks to @ulisesojeda.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions