Skip to content

Handle LookupError when detecting encoding#17

Merged
audreyfeldroy merged 1 commit intobinaryornot:masterfrom
DRMacIver:fix-lookup-error
Aug 19, 2015
Merged

Handle LookupError when detecting encoding#17
audreyfeldroy merged 1 commit intobinaryornot:masterfrom
DRMacIver:fix-lookup-error

Conversation

@DRMacIver
Copy link
Copy Markdown
Contributor

For reasons that are a slight mystery to me, chardet can return
encodings that Python doesn't actually support.

On the assumption that if we can't decode it we're probably not
interested in considering it as text (especially given that chardet
will sometimes detect an encoding that you can't actually decode as
when its confidence is < 1), this handles this commit by
considering it to not be decodable.

For reasons that are a slight mystery to me, chardet can return
encodings that Python doesn't actually support.

On the assumption that if we can't decode it we're probably not
interested in considering it as text (especially given that chardet
will sometimes detect an encoding that you can't actually decode as
when its confidence is < 1), this handles this commit by
considering it to not be decodable.
audreyfeldroy added a commit that referenced this pull request Aug 19, 2015
Handle LookupError when detecting encoding
@audreyfeldroy audreyfeldroy merged commit e42ae33 into binaryornot:master Aug 19, 2015
@audreyfeldroy
Copy link
Copy Markdown
Collaborator

@DRMacIver thanks for catching this, much appreciated.

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.

2 participants