Uploaded image for project: 'Infrastructure'
  1. Infrastructure
  2. INFRA-8578

The markdown processing daemon fails to start when using Python Markdown v2.5.1

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Jul 2015
    • CMS

    Description

      When I try to start the ASF CMS python markdown processing daemon using the instructions here: http://www.apache.org/dev/cmsref.html , with Python 2.7.8 and Python Markdown 2.5.1, I get the following error:

      -----
        File "markdownd.py", line 42, in <module>
          dummy = markdown.markdown(unicode("", "utf-8"), EXTENSIONS)
        File "/usr/local/lib/python2.7/site-packages/markdown/__init__.py", line 464, in markdown
          md = Markdown(*args, **kwargs)
        File "/usr/local/lib/python2.7/site-packages/markdown/__init__.py", line 154, in __init__
          configs=kwargs.get('extension_configs', {}))
        File "/usr/local/lib/python2.7/site-packages/markdown/__init__.py", line 180, in registerExtensions
          ext = self.build_extension(ext, configs.get(ext, {}))
        File "/usr/local/lib/python2.7/site-packages/markdown/__init__.py", line 265, in build_extension
          return module.makeExtension(**configs)
        File "/Users/sarowe/svn/lucene/cms/build/mdx_elementid.py", line 150, in makeExtension
          return IdExtension(configs=configs)
        File "/usr/local/lib/python2.7/site-packages/markdown/extensions/__init__.py", line 36, in __init__
          self.setConfigs(kwargs.pop('configs', {}))
        File "/usr/local/lib/python2.7/site-packages/markdown/extensions/__init__.py", line 75, in setConfigs
          for key, value in items:
      TypeError: 'NoneType' object is not iterable
      -----

      [~gsingers] created an issue about this with the Python-Markdown project on github: https://github.com/waylan/Python-Markdown/issues/357 , where the project owner says it's for the downstream project to fix.

      Here's a patch with a fix that works for me (the same fix as used by the django-wiki project, noted at the bottom of above-linked issue #357) :

      -----
      Index: mdx_elementid.py
      ===================================================================
      --- mdx_elementid.py (revision 926469)
      +++ mdx_elementid.py (working copy)
      @@ -146,7 +146,7 @@
               md.treeprocessors.add("elid", idext, "_begin")
       
       
      -def makeExtension(configs=None):
      +def makeExtension(configs={}):
           return IdExtension(configs=configs)
       
       if __name__ == "__main__":
      -----

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users

          People

            gmcdonald Gavin McDonald
            sarowe Steven Rowe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment