Skip to content

Adding links in different paragraphs raises a TypeError #6

Description

@davide-targa

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions