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

Cannot read line from input when using default length #134

Open
MadJlzz opened this issue May 14, 2022 · 0 comments
Open

Cannot read line from input when using default length #134

MadJlzz opened this issue May 14, 2022 · 0 comments

Comments

@MadJlzz
Copy link

MadJlzz commented May 14, 2022

From
https://github.com/sdispater/cleo/blob/8c3ba5847f33b9da16143f2bba9e3999bb6d3cd5/cleo/io/inputs/input.py#L68-L77

length param default value is None but typing.IO.readline takes an int as parameter:

@abstractmethod
def readline(self, limit: int = -1) -> AnyStr:
  pass

which causes

  'NoneType' object cannot be interpreted as an integer

  at .venv/lib/python3.9/site-packages/cleo/io/inputs/input.py:77 in read_line
       73│         """
       74│         if not self._interactive:
       75│             return default
       76│         
    →  77│         return self._stream.readline(length)
       78│ 
       79│     def close(self) -> None:
       80│         """
       81│         Closes the input.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants