Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

typer.echo() generates TypeError: a bytes-like object is required, not 'str' #884

Copy link
Copy link
@PodioSpaz

Description

@PodioSpaz
Issue body actions

When using typer.echo() or typer.secho() I get...

bpython version 0.21 on top of Python 3.9.1 /home/demo/.cache/pypoetry/virtualenvs/poetry-test-XzZpibJX-py3.9/bin/python
>>> import typer
>>> typer.echo('hello')
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    typer.echo('hello')
  File "/home/demo/.cache/pypoetry/virtualenvs/poetry-test-XzZpibJX-py3.9/lib/python3.9/site-packages/click/utils.py", line 272, in echo
    file.write(message)
  File "/home/demo/.cache/pypoetry/virtualenvs/poetry-test-XzZpibJX-py3.9/lib/python3.9/site-packages/bpython/curtsiesfrontend/coderunner.py", line 218, in write
    self.on_write(s, *args, **kwargs)
  File "/home/demo/.cache/pypoetry/virtualenvs/poetry-test-XzZpibJX-py3.9/lib/python3.9/site-packages/bpython/curtsiesfrontend/repl.py", line 1247, in send_to_stdouterr
    lines = output.split("\n")
TypeError: a bytes-like object is required, not 'str'

This error does not occur with the Python REPL or ptpython.

Tested with Python 3.8.5 and 3.9.1
Typer version: 0.3.2
bpython version: 0.21

A similar problem was mentioned in another issue.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.