You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@allura.apache.org by Dave Brondsema <da...@brondsema.net> on 2017/10/12 16:47:49 UTC

[allura:tickets] #6342 Errors in ForgeLinkPattern parsing



---

** [tickets:#6342] Errors in ForgeLinkPattern parsing**

**Status:** review
**Milestone:** unreleased
**Created:** Thu Jun 06, 2013 10:21 PM UTC by Dave Brondsema
**Last Updated:** Tue Feb 17, 2015 07:54 AM UTC
**Owner:** Dave Brondsema


~~~~
  File "/var/local/allura/Allura/allura/command/show_models.py", line 127, in command
    update_refs=self.options.refs)
  File "/var/local/allura/Allura/allura/tasks/index_tasks.py", line 49, in add_artifacts
    link.ref_id for link in find_shortlinks(s['text']) ]
  File "/var/local/allura/Allura/allura/lib/search.py", line 212, in find_shortlinks
    md.convert(text)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/__init__.py", line 292, in convert
    newRoot = treeprocessor.run(root)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/treeprocessors.py", line 289, in run
    text), child)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/treeprocessors.py", line 110, in __handleInline
    data, patternIndex, startIndex)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/treeprocessors.py", line 237, in __applyPattern
    node = pattern.handleMatch(match)
  File "/var/local/allura/Allura/allura/lib/markdown_extensions.py", line 116, in handleMatch
    if 'notfound' in classes and not self.ext._use_wiki:
UnboundLocalError: local variable 'classes' referenced before assignment
~~~~

Example somewhere in sbg901.arris's content for this:

~~~~
  File "/var/local/allura/Allura/allura/tasks/index_tasks.py", line 49, in add_artifacts
    link.ref_id for link in find_shortlinks(s['text']) ]
  File "/var/local/allura/Allura/allura/lib/search.py", line 212, in find_shortlinks
    md.convert(text)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/__init__.py", line 292, in convert
    newRoot = treeprocessor.run(root)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/treeprocessors.py", line 289, in run
    text), child)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/treeprocessors.py", line 110, in __handleInline
    data, patternIndex, startIndex)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/treeprocessors.py", line 237, in __applyPattern
    node = pattern.handleMatch(match)
  File "/var/local/allura/Allura/allura/lib/markdown_extensions.py", line 107, in handleMatch
    el.set('href', self.sanitize_url(self.unescape(href.strip())))
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/inlinepatterns.py", line 198, in unescape
    return util.INLINE_PLACEHOLDER_RE.sub(get_stash, text)
TypeError: sequence item 0: expected string or Unicode, Element found
~~~~


---

Sent from forge-allura.apache.org because dev@allura.apache.org is subscribed to https://forge-allura.apache.org/p/allura/tickets/

To unsubscribe from further messages, a project admin can change settings at https://forge-allura.apache.org/p/allura/admin/tickets/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.

[allura:tickets] #6342 Errors in ForgeLinkPattern parsing

Posted by Dave Brondsema <da...@brondsema.net>.
- **Milestone**: unreleased --> v1.8.0



---

** [tickets:#6342] Errors in ForgeLinkPattern parsing**

**Status:** closed
**Milestone:** v1.8.0
**Created:** Thu Jun 06, 2013 10:21 PM UTC by Dave Brondsema
**Last Updated:** Fri Oct 13, 2017 01:23 PM UTC
**Owner:** Dave Brondsema


~~~~
  File "/var/local/allura/Allura/allura/command/show_models.py", line 127, in command
    update_refs=self.options.refs)
  File "/var/local/allura/Allura/allura/tasks/index_tasks.py", line 49, in add_artifacts
    link.ref_id for link in find_shortlinks(s['text']) ]
  File "/var/local/allura/Allura/allura/lib/search.py", line 212, in find_shortlinks
    md.convert(text)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/__init__.py", line 292, in convert
    newRoot = treeprocessor.run(root)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/treeprocessors.py", line 289, in run
    text), child)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/treeprocessors.py", line 110, in __handleInline
    data, patternIndex, startIndex)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/treeprocessors.py", line 237, in __applyPattern
    node = pattern.handleMatch(match)
  File "/var/local/allura/Allura/allura/lib/markdown_extensions.py", line 116, in handleMatch
    if 'notfound' in classes and not self.ext._use_wiki:
UnboundLocalError: local variable 'classes' referenced before assignment
~~~~

Example somewhere in sbg901.arris's content for this:

~~~~
  File "/var/local/allura/Allura/allura/tasks/index_tasks.py", line 49, in add_artifacts
    link.ref_id for link in find_shortlinks(s['text']) ]
  File "/var/local/allura/Allura/allura/lib/search.py", line 212, in find_shortlinks
    md.convert(text)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/__init__.py", line 292, in convert
    newRoot = treeprocessor.run(root)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/treeprocessors.py", line 289, in run
    text), child)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/treeprocessors.py", line 110, in __handleInline
    data, patternIndex, startIndex)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/treeprocessors.py", line 237, in __applyPattern
    node = pattern.handleMatch(match)
  File "/var/local/allura/Allura/allura/lib/markdown_extensions.py", line 107, in handleMatch
    el.set('href', self.sanitize_url(self.unescape(href.strip())))
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/inlinepatterns.py", line 198, in unescape
    return util.INLINE_PLACEHOLDER_RE.sub(get_stash, text)
TypeError: sequence item 0: expected string or Unicode, Element found
~~~~


---

Sent from forge-allura.apache.org because dev@allura.apache.org is subscribed to https://forge-allura.apache.org/p/allura/tickets/

To unsubscribe from further messages, a project admin can change settings at https://forge-allura.apache.org/p/allura/admin/tickets/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.

[allura:tickets] Ticket 6342 discussion

Posted by Dave Brondsema <da...@brondsema.net>.
- **status**: open --> review
- **assigned_to**: Dave Brondsema
- **Comment**:

First error fixed long time ago in [f398a06e1ca979922c366d30ad17060b53eb5988]

Second error can be reproduced with `[foo]( http://bar)` and is [fixed in Markdown](https://github.com/Python-Markdown/markdown/issues/155).  Upgrading Markdown from 2.2.0 to 2.2.1 fixes it.  Would be good to upgrade much further, but there are various regressions, mostly with markdown internal placeholders showing up in the output, which is no good.  This starts at 2.3 and perhaps is because of our own extensions needing update, but also I think due to handling invalid markdown (e.g. markdown within html) differently -- but I don't want that to break.  More info at https://github.com/Python-Markdown/markdown/issues/458 and https://github.com/Python-Markdown/markdown/issues/222

Fix in db/6342



---

** [tickets:#6342] Errors in ForgeLinkPattern parsing**

**Status:** review
**Milestone:** unreleased
**Created:** Thu Jun 06, 2013 10:21 PM UTC by Dave Brondsema
**Last Updated:** Tue Feb 17, 2015 07:54 AM UTC
**Owner:** Dave Brondsema


~~~~
  File "/var/local/allura/Allura/allura/command/show_models.py", line 127, in command
    update_refs=self.options.refs)
  File "/var/local/allura/Allura/allura/tasks/index_tasks.py", line 49, in add_artifacts
    link.ref_id for link in find_shortlinks(s['text']) ]
  File "/var/local/allura/Allura/allura/lib/search.py", line 212, in find_shortlinks
    md.convert(text)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/__init__.py", line 292, in convert
    newRoot = treeprocessor.run(root)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/treeprocessors.py", line 289, in run
    text), child)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/treeprocessors.py", line 110, in __handleInline
    data, patternIndex, startIndex)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/treeprocessors.py", line 237, in __applyPattern
    node = pattern.handleMatch(match)
  File "/var/local/allura/Allura/allura/lib/markdown_extensions.py", line 116, in handleMatch
    if 'notfound' in classes and not self.ext._use_wiki:
UnboundLocalError: local variable 'classes' referenced before assignment
~~~~

Example somewhere in sbg901.arris's content for this:

~~~~
  File "/var/local/allura/Allura/allura/tasks/index_tasks.py", line 49, in add_artifacts
    link.ref_id for link in find_shortlinks(s['text']) ]
  File "/var/local/allura/Allura/allura/lib/search.py", line 212, in find_shortlinks
    md.convert(text)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/__init__.py", line 292, in convert
    newRoot = treeprocessor.run(root)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/treeprocessors.py", line 289, in run
    text), child)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/treeprocessors.py", line 110, in __handleInline
    data, patternIndex, startIndex)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/treeprocessors.py", line 237, in __applyPattern
    node = pattern.handleMatch(match)
  File "/var/local/allura/Allura/allura/lib/markdown_extensions.py", line 107, in handleMatch
    el.set('href', self.sanitize_url(self.unescape(href.strip())))
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/inlinepatterns.py", line 198, in unescape
    return util.INLINE_PLACEHOLDER_RE.sub(get_stash, text)
TypeError: sequence item 0: expected string or Unicode, Element found
~~~~


---

Sent from forge-allura.apache.org because dev@allura.apache.org is subscribed to https://forge-allura.apache.org/p/allura/tickets/

To unsubscribe from further messages, a project admin can change settings at https://forge-allura.apache.org/p/allura/admin/tickets/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.

[allura:tickets] #6342 Errors in ForgeLinkPattern parsing

Posted by Kenton Taylor <kt...@slashdotmedia.com>.
- **status**: review --> closed
- **Comment**:

Merged.



---

** [tickets:#6342] Errors in ForgeLinkPattern parsing**

**Status:** closed
**Milestone:** unreleased
**Created:** Thu Jun 06, 2013 10:21 PM UTC by Dave Brondsema
**Last Updated:** Thu Oct 12, 2017 04:47 PM UTC
**Owner:** Dave Brondsema


~~~~
  File "/var/local/allura/Allura/allura/command/show_models.py", line 127, in command
    update_refs=self.options.refs)
  File "/var/local/allura/Allura/allura/tasks/index_tasks.py", line 49, in add_artifacts
    link.ref_id for link in find_shortlinks(s['text']) ]
  File "/var/local/allura/Allura/allura/lib/search.py", line 212, in find_shortlinks
    md.convert(text)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/__init__.py", line 292, in convert
    newRoot = treeprocessor.run(root)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/treeprocessors.py", line 289, in run
    text), child)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/treeprocessors.py", line 110, in __handleInline
    data, patternIndex, startIndex)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/treeprocessors.py", line 237, in __applyPattern
    node = pattern.handleMatch(match)
  File "/var/local/allura/Allura/allura/lib/markdown_extensions.py", line 116, in handleMatch
    if 'notfound' in classes and not self.ext._use_wiki:
UnboundLocalError: local variable 'classes' referenced before assignment
~~~~

Example somewhere in sbg901.arris's content for this:

~~~~
  File "/var/local/allura/Allura/allura/tasks/index_tasks.py", line 49, in add_artifacts
    link.ref_id for link in find_shortlinks(s['text']) ]
  File "/var/local/allura/Allura/allura/lib/search.py", line 212, in find_shortlinks
    md.convert(text)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/__init__.py", line 292, in convert
    newRoot = treeprocessor.run(root)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/treeprocessors.py", line 289, in run
    text), child)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/treeprocessors.py", line 110, in __handleInline
    data, patternIndex, startIndex)
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/treeprocessors.py", line 237, in __applyPattern
    node = pattern.handleMatch(match)
  File "/var/local/allura/Allura/allura/lib/markdown_extensions.py", line 107, in handleMatch
    el.set('href', self.sanitize_url(self.unescape(href.strip())))
  File "/var/local/env-allura/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/inlinepatterns.py", line 198, in unescape
    return util.INLINE_PLACEHOLDER_RE.sub(get_stash, text)
TypeError: sequence item 0: expected string or Unicode, Element found
~~~~


---

Sent from forge-allura.apache.org because dev@allura.apache.org is subscribed to https://forge-allura.apache.org/p/allura/tickets/

To unsubscribe from further messages, a project admin can change settings at https://forge-allura.apache.org/p/allura/admin/tickets/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.