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

ValueError when using with gzip_page decorator #104

Open
tremby opened this issue Sep 27, 2016 · 2 comments
Open

ValueError when using with gzip_page decorator #104

tremby opened this issue Sep 27, 2016 · 2 comments
Labels

Comments

@tremby
Copy link

tremby commented Sep 27, 2016

I'm getting a ValueError: object of type 'NoneType' has no len() when enabling minification and running a view which is decorated with django.views.decorators.gzip.gzip_page.

Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/django/core/handlers/base.py", line 131, in get_response
    response = middleware_method(request, response)
  File "/usr/local/lib/python3.4/dist-packages/htmlmin/middleware.py", line 44, in process_response
    parser=parser)
  File "/usr/local/lib/python3.4/dist-packages/htmlmin/minify.py", line 45, in html_minify
    soup = bs4.BeautifulSoup(html_code, parser)
  File "/usr/local/lib/python3.4/dist-packages/bs4/__init__.py", line 192, in __init__
    elif len(markup) <= 256 and (
TypeError: object of type 'NoneType' has no len()
@Diegow3b
Copy link

Same here, when im activating GzipMiddleware im getting the same error

@sikmir
Copy link

sikmir commented Jan 27, 2018

The same problem.

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

4 participants