Skip to content

Ensure that stdin is opened with mode 'rb' #38

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
Dec 2, 2014

Conversation

lpsinger
Copy link
Contributor

This fixes the following error:

$ echo foo bar | chardetect
Traceback (most recent call last):
...
TypeError: can't use a bytes pattern on a string-like object

This fixes the following error:

    $ echo foo bar | chardetect
    Traceback (most recent call last):
    ...
    TypeError: can't use a bytes pattern on a string-like object
@dan-blanchard
Copy link
Member

Thank you for making a pull request that fixes the issue instead of just filing an issue!

I'll have to test this on 2.7 and 3.3 when I get home from Thanksgiving, but this should be fine at first glance.

@dan-blanchard dan-blanchard reopened this Dec 2, 2014
@dan-blanchard dan-blanchard merged commit 72bfb15 into chardet:master Dec 2, 2014
@dan-blanchard
Copy link
Member

I made a little change to make this work on 2.7 and 3.3, by just using sys.stdin.buffer on Python 3.

@dan-blanchard dan-blanchard mentioned this pull request Apr 11, 2017
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