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

sanitizer import error due to changes in html5lib #336

Closed
nargeel opened this issue Jul 16, 2016 · 11 comments
Closed

sanitizer import error due to changes in html5lib #336

nargeel opened this issue Jul 16, 2016 · 11 comments

Comments

@nargeel
Copy link

nargeel commented Jul 16, 2016

I get the following import error when using djangocms-text-ckeditor with html5lib 0.999999999 installed. Please not that I did not specified any specific version for html5lib and it has been installed by default.

 File "....../lib/python3.4/site-packages/djangocms_text_ckeditor/models.py", line 13, in <module>
    from .html import clean_html, extract_images
  File "...../lib/python3.4/site-packages/djangocms_text_ckeditor/html.py", line 8, in <module>

    from html5lib import sanitizer, serializer, treebuilders, treewalkers
ImportError: cannot import name 'sanitizer'

See also release notes for html5lib Released on July 14, 2016: https://pypi.python.org/pypi/html5lib

@czpython
Copy link
Contributor

@saeed-222 Thanks. We've released a new version of djangocms-text-ckeditor that pins the html5lib version to < 0.999999999.

@jedie
Copy link

jedie commented Jul 20, 2016

Ran into the same problem :(

New release not on PyPi, yet?!?

EDIT: Ah, 3.0.1 containes 7c2bc02

So everything should be fine.

Hope we get normal version numbers, soon, see: html5lib/html5lib-python#282
Strange!

We've released a new version of djangocms-text-ckeditor that pins the html5lib version to < 0.999999999.

But this is not really a solution, isn't it?

@nargeel
Copy link
Author

nargeel commented Jul 29, 2016

I don't think that a temporarily work-a-round would solve this issue, Adding support for new changes will be a better idea.

In the mean time, it might be better to use something like this:

html5lib!=0.9999,!=0.99999,!=0.999999999,>=0.90

or

html5lib==-0.999

@czpython
Copy link
Contributor

czpython commented Jul 29, 2016

Pinning html5lib version to < 0.999999999 is perfectly fine as long as other apps don't require a higher version. I agree that adding support for html5lib >= 0.999999999 would be better but there's only so much we can do each time a new dependency is released.

In the meantime, we've removed html5lib as a dependency from django-cms 3.3.x and will backport to 3.2.x

@czpython
Copy link
Contributor

Just for the sake of clarity, what I meant with "there's only so much we can do" is that we're focusing all our efforts on finishing the long term release of djangoCMS. That's the only reason why we've pinned the html5lib version.

We would really appreciate if someone has the time to contribute a backwards compatible patch that adds compatibility with the latest html5lib.

gitsimon added a commit to tanzquotient/website that referenced this issue Aug 27, 2016
we have to fix html5lib<0.99999999 because later a function needed by django-cms is removed and django-cms is not updated yet (see django-cms/djangocms-text-ckeditor#336)
@Chronial
Copy link

Chronial commented Sep 30, 2016

We would really appreciate if someone has the time to contribute a backwards compatible patch that adds compatibility with the latest html5lib.

@czpython Is it essential that it is backwards compatible? This adds a lot of complexity and the old implementation seems dangerous, since it modifies global settings of html5lib: https://github.com/divio/djangocms-text-ckeditor/blob/6e0b6c2fb48984ee579cc3ca672b5064af1bf10d/djangocms_text_ckeditor/html.py#L23

@rando305
Copy link

It sure would be good if you guys fixed this. Pinning it to .9x7 deosn't help when other packages require .9x9

@jvamvas
Copy link
Contributor

jvamvas commented Dec 12, 2016

@czpython Would it be possible to re-open this issue or to create another issue for the html5lib version problem? I'm afraid it might slip off the project's radar otherwise.

@czpython
Copy link
Contributor

Thanks for the follow up, created ticket #403

@DanielTate
Copy link

This seems to be an issue still with the new Django-cms update

@czpython
Copy link
Contributor

Hello,
This issue is tracked in #403, the cms is decoupled from this app so it won't affect this issue.

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

7 participants