Skip to content

readchar.readchar() seems to return bytes instead of a string #37

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

Closed
jacobcarpenter opened this issue Aug 25, 2018 · 1 comment
Closed

Comments

@jacobcarpenter
Copy link

The documentation for readchar states:

Reads the next char from stdin, returning it as a string with length 1.

However, it appears to return a byte sequence:

example.py:

import readchar

print("Press a key")
pressed = readchar.readchar()

print(type(pressed))

Output:

$ python example.py
Press a key
<class 'bytes'>

This is using

$ pip show readchar
Name: readchar
Version: 2.0.1
Summary: Utilities to read single characters and key-strokes
Home-page: https://github.com/magmax/python-readchar
Author: Miguel Ángel García
Author-email: [email protected]
License: MIT

on Windows in a Git Bash prompt.

@Cube707
Copy link
Collaborator

Cube707 commented Jul 25, 2022

fixed in v4.0.0

@Cube707 Cube707 closed this as completed Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants