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

Fix undesired exception (ValueError) on getitem of instance CharsetMatches #52

Merged
merged 1 commit into from
Jul 13, 2021

Conversation

Ousret
Copy link
Member

@Ousret Ousret commented Jul 12, 2021

One could raise an unwanted exception upon a CharsetMatches instance.

from charset_normalizer.api import from_path

if __name__ == "__main__":

    r = from_path("./data/sample.1.ar.srt")

    r["MacCyrilliX"]

In the current conditions, this would raise ValueError instead of KeyError.

@Ousret Ousret merged commit bee6866 into master Jul 13, 2021
@Ousret Ousret deleted the patch-except-valueerror branch July 13, 2021 06:08
@Ousret Ousret mentioned this pull request Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant