Skip to content

bpo-26407: Do not mask errors in csv.#20536

Merged
serhiy-storchaka merged 1 commit intopython:masterfrom
serhiy-storchaka:csv-errors-in-iter
Jun 22, 2020
Merged

bpo-26407: Do not mask errors in csv.#20536
serhiy-storchaka merged 1 commit intopython:masterfrom
serhiy-storchaka:csv-errors-in-iter

Conversation

@serhiy-storchaka
Copy link
Copy Markdown
Member

@serhiy-storchaka serhiy-storchaka commented May 30, 2020

Unexpected errors in calling the __iter__ method are no longer
masked by TypeError in csv.reader(), csv.writer.writerow() and
csv.writer.writerows().

https://bugs.python.org/issue26407

Unexpected errors in calling the __iter__ method are no longer
masked by TypeError in csv.reader(), csv.writer.writerow() and
csv.writer.writerows().
Copy link
Copy Markdown
Contributor

@aeros aeros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with directly raising other exceptions from __iter__ rather than suppressing them w/ TypeError, as it can easily obfuscate bugs. The more general discussion will likely have to take place somewhere like python-dev, but for now, I think changing csv.writerow() has a narrow enough scope.

+1, other than a comment/question on the C changes.

@serhiy-storchaka serhiy-storchaka merged commit c88239f into python:master Jun 22, 2020
@miss-islington
Copy link
Copy Markdown
Contributor

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7, 3.8, 3.9.
🐍🍒⛏🤖

@serhiy-storchaka serhiy-storchaka deleted the csv-errors-in-iter branch June 22, 2020 08:22
@bedevere-bot
Copy link
Copy Markdown

GH-21047 is a backport of this pull request to the 3.9 branch.

@miss-islington
Copy link
Copy Markdown
Contributor

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.8 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker c88239f864a27f673c0f0a9e62d2488563f9d081 3.8

@miss-islington
Copy link
Copy Markdown
Contributor

Sorry @serhiy-storchaka, I had trouble checking out the 3.7 backport branch.
Please backport using cherry_picker on command line.
cherry_picker c88239f864a27f673c0f0a9e62d2488563f9d081 3.7

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 22, 2020
Unexpected errors in calling the __iter__ method are no longer
masked by TypeError in csv.reader(), csv.writer.writerow() and
csv.writer.writerows().
(cherry picked from commit c88239f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@miss-islington
Copy link
Copy Markdown
Contributor

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.6 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker c88239f864a27f673c0f0a9e62d2488563f9d081 3.6

miss-islington added a commit that referenced this pull request Jun 22, 2020
Unexpected errors in calling the __iter__ method are no longer
masked by TypeError in csv.reader(), csv.writer.writerow() and
csv.writer.writerows().
(cherry picked from commit c88239f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@miss-islington
Copy link
Copy Markdown
Contributor

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

@miss-islington
Copy link
Copy Markdown
Contributor

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.8 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker c88239f864a27f673c0f0a9e62d2488563f9d081 3.8

fasih pushed a commit to fasih/cpython that referenced this pull request Jun 29, 2020
Unexpected errors in calling the __iter__ method are no longer
masked by TypeError in csv.reader(), csv.writer.writerow() and
csv.writer.writerows().
@bedevere-bot
Copy link
Copy Markdown

GH-24021 is a backport of this pull request to the 3.8 branch.

serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Dec 31, 2020
Unexpected errors in calling the __iter__ method are no longer
masked by TypeError in csv.reader(), csv.writer.writerow() and
csv.writer.writerows()..
(cherry picked from commit c88239f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this pull request Jan 1, 2021
Unexpected errors in calling the __iter__ method are no longer
masked by TypeError in csv.reader(), csv.writer.writerow() and
csv.writer.writerows().
(cherry picked from commit c88239f)
@serhiy-storchaka serhiy-storchaka removed their assignment Sep 8, 2023
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.

5 participants