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

treat spaces as single-char bytes instead of strings for python 2/3 #92

Closed
wants to merge 3 commits into from

Conversation

jackdied
Copy link

The initial state of self._prev is pretty suspect currently. python2 will gladly compare a string to an int (coming from wrap_ord()) and quietly return False. Likewise it will do tests for one char of a bytestring like:
b'x' in [ord(b'x')] # unexpectedly False

This patch fixes handling of the initial condition and comparing spaces but not the other issue of the class level character constants.

@dan-blanchard
Copy link
Member

Thanks for the PR. I'm actually working on a large overhaul of chardet on this branch, so this will be actually unnecessary soon.

@dan-blanchard
Copy link
Member

The WIP to address this is #99. Closing this in favor of that.

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.

None yet

2 participants