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

config file's 'md_extensions' setting causes traceback if delimited with multiple spaces #201

Closed
ernstki opened this issue Jan 16, 2020 · 0 comments · Fixed by #202
Closed
Assignees
Labels

Comments

@ernstki
Copy link

ernstki commented Jan 16, 2020

Python 3.6.3 on Ubuntu 18.04, using latest nvpy (2.0.2) from GitHub.

But the shipped example config has two spaces between markdown.extensions.codehilite and markdown.extensions.tables for the md_extensions setting:

# extensions for markdown.py                                                
# if you use multiple extensions, separate with spaces.                     
# md_extensions = markdown.extensions.codehilite  markdown.extensions.tables

This is probably misinterpreted by a split() somewhere, resulting in this backtrace when you use Ctrl+M to render Markdown:

Traceback: ValueError: Empty module name
2020-01-16 01:35:08,146 - ERROR - Traceback (most recent call last):
  File "/usr/lib/python3.6/tkinter/__init__.py", line 1705, in __call__
    return self.func(*args)
  File "/home/myuser/.local/lib/python3.6/site-packages/nvpy/view.py", line 1565, in cmd_markdown
    self.notify_observers('command:markdown', None)
  File "/home/myuser/.local/lib/python3.6/site-packages/nvpy/utils.py", line 205, in notify_observers
    self.__invoke_observer(o, evt_type, evt)
  File "/home/myuser/.local/lib/python3.6/site-packages/nvpy/utils.py", line 229, in __invoke_observer
    observer(self, event_type, event)
  File "/home/myuser/.local/lib/python3.6/site-packages/nvpy/debug.py", line 30, in wrapper
    return fn(*args, **kwargs)
  File "/home/myuser/.local/lib/python3.6/site-packages/nvpy/tk.py", line 30, in wrapper
    return fn(*args, **kwargs)
  File "/home/myuser/.local/lib/python3.6/site-packages/nvpy/nvpy.py", line 610, in observer_view_markdown
    fn = self.helper_markdown_to_html()
  File "/home/myuser/.local/lib/python3.6/site-packages/nvpy/nvpy.py", line 541, in helper_markdown_to_html
    html = markdown.markdown(c, extensions=exts)
  File "/home/myuser/.local/lib/python3.6/site-packages/markdown/__init__.py", line 493, in markdown
    md = Markdown(*args, **kwargs)
  File "/home/myuser/.local/lib/python3.6/site-packages/markdown/__init__.py", line 159, in __init__
    configs=kwargs.get('extension_configs', {}))
  File "/home/myuser/.local/lib/python3.6/site-packages/markdown/__init__.py", line 185, in registerExtensions
    ext = self.build_extension(ext, configs.get(ext, {}))
  File "/home/myuser/.local/lib/python3.6/site-packages/markdown/__init__.py", line 231, in build_extension
    module = importlib.import_module(ext_name)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 991, in _gcd_import
  File "", line 930, in _sanity_check
ValueError: Empty module name
@yuuki0xff yuuki0xff added the bug label Jan 16, 2020
@yuuki0xff yuuki0xff self-assigned this Jan 16, 2020
@ernstki ernstki changed the title .nv.py 'md_extensions' config setting sensitive to multiple spaces config file's 'md_extensions' setting causes traceback if delimited with multiple spaces Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants