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 accessing the 'alphabets' property when the payload contain surrogate like characters #68

Merged
merged 1 commit into from
Jul 23, 2021

Conversation

Ousret
Copy link
Member

@Ousret Ousret commented Jul 23, 2021

Brief:

Accessing the alphabets property of a CharsetMatch instance when the original payload contains a surrogate-like character may raise an unexpected exception.

An example/test case is added to ensure this bad case will not happen again.

@Ousret
Copy link
Member Author

Ousret commented Jul 23, 2021

line 211, in alphabets
    self._unicode_ranges = sorted(list(detected_ranges))
TypeError: '<' not supported between instances of 'str' and 'NoneType'

given traceback

@Ousret Ousret added the bug Something isn't working label Jul 23, 2021
@Ousret Ousret changed the title 🐛 Fix accessing the 'alphabets' property when the payload contain surrogate like characters 🐛 Fix accessing the 'alphabets' property when the payload contain surrogate like characters Jul 23, 2021
@Ousret Ousret merged commit 87a5a98 into master Jul 23, 2021
@Ousret Ousret deleted the bugfix-alphabets-property-sort branch July 23, 2021 21:15
@Ousret Ousret mentioned this pull request Jul 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

1 participant