Skip to content

%help triggers an unhandled error #28

@hugetim

Description

@hugetim

%help without a command name listed after it causes cell execution to fail, rather than displaying a helpful error message. This traceback shows up in the console:

-[IPKernelApp] ERROR | Exception in message handler:
Traceback (most recent call last):
  File "C:\Users\tjhuegerich\AppData\Local\Continuum\anaconda3\envs\Python2022-05\lib\site-packages\ipykernel\kernelbase.py", line 406, in dispatch_shell
    await result
  File "C:\Users\tjhuegerich\AppData\Local\Continuum\anaconda3\envs\Python2022-05\lib\site-packages\ipykernel\kernelbase.py", line 721, in execute_request
    reply_content = self.do_execute(
  File "c:\users\tjhuegerich\onedrive - lrca\nbstata\nbstata\kernel.py", line 126, in do_execute
    code_cell = Cell(self, code, silent)
  File "c:\users\tjhuegerich\onedrive - lrca\nbstata\nbstata\cell.py", line 22, in __init__
    self.code = magic_handler.magic(code_w_magics, kernel, self)
  File "c:\users\tjhuegerich\onedrive - lrca\nbstata\nbstata\magics.py", line 178, in magic
    code = self._do_magic(name, code, kernel, cell)
  File "c:\users\tjhuegerich\onedrive - lrca\nbstata\nbstata\magics.py", line 164, in _do_magic
    return getattr(self, "magic_" + name.lstrip('%'))(code, kernel, cell)
  File "c:\users\tjhuegerich\onedrive - lrca\nbstata\nbstata\magics.py", line 425, in magic_help
    'text/html': self._get_help_html(code),
  File "c:\users\tjhuegerich\onedrive - lrca\nbstata\nbstata\magics.py", line 383, in _get_help_html
    soup.find('h2').decompose()
AttributeError: 'NoneType' object has no attribute 'decompose'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions