cleo icon indicating copy to clipboard operation
cleo copied to clipboard

Cannot read line from input when using default length

Open MadJlzz opened this issue 3 years ago • 0 comments

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.

MadJlzz avatar May 14 '22 20:05 MadJlzz