Skip to content

Cannot read line from input when using default length #134

@MadJlzz

Description

@MadJlzz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working as expectedrequires confirmationA possible bug that need to be confirmed

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions