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

Prevent Error in isHTML() #577

Merged
merged 3 commits into from May 2, 2019

Conversation

@icemac
Copy link
Member

commented Apr 30, 2019

If the parameter cannot be decoded none of the following checkes can lead to True.
The last one even breaks on Python 3 because it tries to find a text in a bytes object.

Before it broke with:

  File ".../ZPublisher/HTTPResponse.py", line 470, in isHTML
    if text.find('</') > 0:
TypeError: argument should be integer or bytes-like object, not 'str'

icemac added some commits Apr 30, 2019

Prevent Error in isHTML()
If the parameter cannot be decoded none of the following checkes can lead to `True`.
The last one even breaks on Python 3 because it tries to find a `text` in a `bytes` object.

@icemac icemac marked this pull request as ready for review May 2, 2019

@icemac icemac requested review from dataflake and pbauer May 2, 2019

@dataflake dataflake merged commit b6fa2ab into master May 2, 2019

3 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.008%) to 81.39%
Details

@dataflake dataflake deleted the icemac-patch-1 branch May 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.