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

gh-92336: linecache.getline should not raise exceptions on decoding errors #94410

Merged
merged 3 commits into from Jun 30, 2022

Conversation

iritkatriel
Copy link
Member

@iritkatriel iritkatriel commented Jun 29, 2022

The documentation for getline says:

This function will never raise an exception — it will return '' on errors

But it currently does raise exception for encoding errors. This PR fixes that.

@iritkatriel iritkatriel changed the title bpo-92336: linecache.getline should not raise exceptions on decoding errors gh-92336: linecache.getline should not raise exceptions on decoding errors Jun 29, 2022
@iritkatriel iritkatriel requested a review from gpshead Jun 29, 2022
Lib/test/test_linecache.py Outdated Show resolved Hide resolved
Lib/linecache.py Show resolved Hide resolved
@iritkatriel iritkatriel merged commit 21cbdae into python:main Jun 30, 2022
14 checks passed
@miss-islington
Copy link
Contributor

miss-islington commented Jun 30, 2022

Thanks @iritkatriel for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11.
🐍🍒🤖

@bedevere-bot
Copy link

bedevere-bot commented Jun 30, 2022

GH-94434 is a backport of this pull request to the 3.11 branch.

@bedevere-bot
Copy link

bedevere-bot commented Jun 30, 2022

GH-94435 is a backport of this pull request to the 3.10 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 30, 2022
…ding errors (pythonGH-94410)

(cherry picked from commit 21cbdae)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 30, 2022
…ding errors (pythonGH-94410)

(cherry picked from commit 21cbdae)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
miss-islington added a commit that referenced this pull request Jun 30, 2022
…rrors (GH-94410)

(cherry picked from commit 21cbdae)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
miss-islington added a commit that referenced this pull request Jun 30, 2022
…rrors (GH-94410)

(cherry picked from commit 21cbdae)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
gvanrossum pushed a commit to gvanrossum/cpython that referenced this pull request Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants