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

NameError: name 'unicode' is not defined #85

Closed
ghost opened this issue May 25, 2015 · 2 comments
Closed

NameError: name 'unicode' is not defined #85

ghost opened this issue May 25, 2015 · 2 comments

Comments

@ghost
Copy link

ghost commented May 25, 2015

I am using Django 1.8.2 on Python 3.4.2.
I have added the appropriate middleware classes and set HTML_MINIFY = True in order to test it while having DEBUG on.

When I run my development server, I get a "NameError" type of error, with the message "name 'unicode' is not defined".

Exception Value:    
name 'unicode' is not defined
Exception Location: /Users/drcooldude/Desktop/testproject/env/lib/python3.4/site-packages/htmlmin/minify.py in html_minify, line 43
Python Executable:  /Users/drcooldude/Desktop/testproject/env/bin/python

Traceback:
File "/Users/drcooldude/Desktop/testproject/env/lib/python3.4/site-packages/django/core/handlers/base.py" in get_response
  223.                 response = middleware_method(request, response)
File "/Users/drcooldude/Desktop/testproject/env/lib/python3.4/site-packages/htmlmin/middleware.py" in process_response
  44.                                            parser=parser)
File "/Users/drcooldude/Desktop/testproject/env/lib/python3.4/site-packages/htmlmin/minify.py" in html_minify
  43.     return unicode(mini_soup)

According to my traceback, the error is located in minify.py at line 43.

@ghost
Copy link
Author

ghost commented May 25, 2015

Found out that the error is because of incompatibility with Python 3. There is currently a pull request open that should fix it, but it's more than a year old: #72

@ghost
Copy link
Author

ghost commented May 26, 2015

Closing this, see #86

@ghost ghost closed this as completed May 26, 2015
This issue was closed.
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

No branches or pull requests

0 participants