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

wordcounter assumes stream is bytes #76

Open
huard opened this issue Jan 10, 2019 · 0 comments
Open

wordcounter assumes stream is bytes #76

huard opened this issue Jan 10, 2019 · 0 comments
Labels

Comments

@huard
Copy link
Contributor

huard commented Jan 10, 2019

Description

In the _handler, we have

        def words(f):
            for line in f:
                for word in wordre.findall(line.decode('UTF-8')):
                    yield word

which assumes line has a decode method, but the supported_format (TEXT) does not explicitly specify that the encoding is utf-8. So if the content is passed as an embedded string in the request, with no encoding information, the process fails.

@cehbrecht cehbrecht added the bug label Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants