pydanny / django-wysiwyg

A Django application for making Django textareas rich text editors. Certainly as a template tag and possibly as a form widget.
http://django-wysiwyg.readthedocs.org
MIT License
465 stars 63 forks source link

TypeError: clean_html() takes no arguments (1 given) #50

Closed lucas03 closed 9 years ago

lucas03 commented 9 years ago

Hi, I am getting this unorthodox error and I have no idea why. My code works on my personal computer.

$ ./manage.py shell
Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import django_wysiwyg
>>> print(django_wysiwyg.VERSION)
['0', '7', '0']
>>> django_wysiwyg.clean_html("<b><script>alert(1)</script></b>")
u'<b><script>alert(1)</script></b>'

However on my server I get error:

$ ./manage.py shell
Python 2.7.3 (default, Mar 13 2014, 11:03:55) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import django_wysiwyg
>>> print(django_wysiwyg.VERSION)
['0', '7', '0']
>>> django_wysiwyg.clean_html("<b><script>alert(1)</script></b>")
Traceback (most recent call last):
  File "<console>", line 1, in <module>
TypeError: clean_html() takes no arguments (1 given)

Like you can see, I am using different python versions (my personal computer is ubuntu and server is debian). Edit1: I am getting same error on openshift.com with python 2.7.5

lucas03 commented 9 years ago

My bad. I thought one of mentioned dependencies would be enough. I installed pytidylib (I think) only and it did not work. So both pytidylib and html5lib are required.