Skip to content

gh-113796: Add more validation checks in the csv.Dialect constructor #113797

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

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Jan 7, 2024

ValueError is now raised if the same character is used in different roles.

…uctor

ValueError is now raised if the same character is used in different roles.
Comment on lines 1119 to +1123
class mydialect(csv.Dialect):
pass
delimiter = ','
quoting = csv.QUOTE_ALL
quotechar = '"'
lineterminator = '\r\n'
Copy link
Member Author

Choose a reason for hiding this comment

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

This test was broken. In most cases the exception was raised for different reason, not because wrong specified value, but because of the lack of required default values.

@serhiy-storchaka serhiy-storchaka merged commit c8351a6 into python:main Jan 22, 2024
@serhiy-storchaka serhiy-storchaka deleted the csv-dialect-validate branch January 22, 2024 13:34
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
…uctor (pythonGH-113797)

ValueError is now raised if the same character is used in different roles.
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
…uctor (pythonGH-113797)

ValueError is now raised if the same character is used in different roles.
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 this pull request may close these issues.

1 participant