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

Adding links in different paragraphs raises a TypeError #6

Open
davide-targa opened this issue Jun 15, 2020 · 0 comments · May be fixed by #7
Open

Adding links in different paragraphs raises a TypeError #6

davide-targa opened this issue Jun 15, 2020 · 0 comments · May be fixed by #7

Comments

@davide-targa
Copy link

Using the buildout included with the egg with python3.7.

To replicate the issue:

  1. Start plone instance and creare a new site;
  2. Upload a file (I used the pdf in the ‘test’ folder);
  3. Add a new page with two paragraphs;
  4. Link a word of the first paragraph to the file and save the page.

A TypeError is raised:

2020-06-15 15:31:35,284 ERROR   [plone.app.textfield:86][waitress] Transform exception
Traceback (most recent call last):
  File "/home/davide/sites/collective.outputfilters.enhancelinks/eggs/plone.app.textfield-1.3.2-py3.7.egg/plone/app/textfield/transform.py", line 62, in __call__
    encoding=value.encoding)
  File "/home/davide/sites/collective.outputfilters.enhancelinks/eggs/Products.PortalTransforms-3.1.7-py3.7.egg/Products/PortalTransforms/TransformEngine.py", line 173, in convertTo
    usedby=usedby, **kwargs)
  File "/home/davide/sites/collective.outputfilters.enhancelinks/eggs/Products.PortalTransforms-3.1.7-py3.7.egg/Products/PortalTransforms/chain.py", line 49, in convert
    data = transform.convert(orig, data, **kwargs)
  File "/home/davide/sites/collective.outputfilters.enhancelinks/eggs/Products.PortalTransforms-3.1.7-py3.7.egg/Products/PortalTransforms/Transform.py", line 202, in convert
    return self._v_transform.convert(*args, **kwargs)
  File "/home/davide/sites/collective.outputfilters.enhancelinks/eggs/plone.outputfilters-3.1.2-py3.7.egg/plone/outputfilters/transforms/html_to_plone_outputfilters_html.py", line 33, in convert
    res = apply_filters(filters, orig)
  File "/home/davide/sites/collective.outputfilters.enhancelinks/eggs/plone.outputfilters-3.1.2-py3.7.egg/plone/outputfilters/__init__.py", line 7, in apply_filters
    res = filter(data)
  File "/home/davide/sites/collective.outputfilters.enhancelinks/src/collective/outputfilters/enhancelinks/enhance_links.py", line 200, in __call__
    self.process(data)
  File "/home/davide/sites/collective.outputfilters.enhancelinks/src/collective/outputfilters/enhancelinks/enhance_links.py", line 186, in process
    raw_html += tail
TypeError: can only concatenate str (not "bytes") to str

davide-targa added a commit to unifeweb/collective.outputfilters.enhancelinks that referenced this issue Jun 15, 2020
Remove useless call of the encode method on the tail string. The
subsequent concatenation between str and bytes, raises a TypeError.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant