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

_pyrepl.readline._ReadlineWrapper.get_line_buffer should return a str, not a bytes object #123228

Closed
cfbolz opened this issue Aug 22, 2024 · 4 comments
Labels
topic-repl Related to the interactive shell type-bug An unexpected behavior, bug, or error

Comments

@cfbolz
Copy link
Contributor

cfbolz commented Aug 22, 2024

Bug report

Bug description:

_pyrepl.readline._ReadlineWrapper.get_line_buffer should return a str, not a bytes object, because readline.get_line_buffer also returns an str, not a bytes.

this has very little effect in CPython, but in PyPy it causes various problem, because we don't have a readline module at all, and use _pyrepl.readline instead.

I'm working on a PR.

CPython versions tested on:

3.13, CPython main branch

Operating systems tested on:

No response

Linked PRs

@cfbolz cfbolz added the type-bug An unexpected behavior, bug, or error label Aug 22, 2024
@Eclips4 Eclips4 added the topic-repl Related to the interactive shell label Aug 22, 2024
@skirpichev
Copy link
Contributor

I took liberty to post a pr: #123281

cfbolz added a commit that referenced this issue Aug 24, 2024
…23281)

Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Aug 24, 2024
…() (pythonGH-123281)

(cherry picked from commit ca18ff2)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
pablogsal pushed a commit that referenced this issue Aug 24, 2024
…r() (GH-123281) (#123293)

gh-123228: fix return type for _ReadlineWrapper.get_line_buffer() (GH-123281)
(cherry picked from commit ca18ff2)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
@cfbolz
Copy link
Contributor Author

cfbolz commented Aug 24, 2024

this is now fixed, thanks everyone!

@cfbolz cfbolz closed this as completed Aug 24, 2024
@cfbolz
Copy link
Contributor Author

cfbolz commented Aug 24, 2024

Ouch, there's a leaking file descriptor in the new test: #123281 (comment)
I know where, can fix it.

@cfbolz
Copy link
Contributor Author

cfbolz commented Aug 25, 2024

ok, hopefully we're actually done this time.

@cfbolz cfbolz closed this as completed Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-repl Related to the interactive shell type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants