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

add_doc with an invalid doc -> crash jupyter kernel #187

Open
rmalouf opened this issue Oct 2, 2022 · 1 comment
Open

add_doc with an invalid doc -> crash jupyter kernel #187

rmalouf opened this issue Oct 2, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@rmalouf
Copy link

rmalouf commented Oct 2, 2022

Running tomotopy (0.12.3) in a jupyter notebook. Calling LDAModel.add_doc with an invalid document, e.g.:

mdl.add_doc([['a', 'b']])

or

mdl.add_doc([[1, 2]])

crashes the kernel. Here's what I think is the relevant part of the traceback:

Error in sys.excepthook:
Traceback (most recent call last):
  File "/opt/conda/lib/python3.10/site-packages/ipykernel/kernelapp.py", line 202, in excepthook
    traceback.print_exception(etype, evalue, tb, file=sys.__stderr__)
  File "/opt/conda/lib/python3.10/traceback.py", line 119, in print_exception
    te = TracebackException(type(value), value, tb, limit=limit, compact=True)
  File "/opt/conda/lib/python3.10/traceback.py", line 536, in __init__
    e.__cause__.__traceback__,
AttributeError: 'str' object has no attribute '__traceback__'

Original exception was:
TypeError: print_exception(): Exception expected for value, str found

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.10/site-packages/IPython/core/interactiveshell.py", line 3398, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "/tmp/ipykernel_274773/1810559270.py", line 1, in <cell line: 1>
ValueError: cannot convert 1 into appropriate C++ type

If I try the same thing in a normal python interpreter, I get the error:

TypeError: print_exception(): Exception expected for value, str found

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: cannot convert 1 into appropriate C++ type

with no crash.

@rmalouf rmalouf changed the title add_doc with an invalid doc -> crash add_doc with an invalid doc -> crash jupyter kernel Oct 2, 2022
@bab2min bab2min added the bug Something isn't working label Oct 3, 2022
@bab2min
Copy link
Owner

bab2min commented Oct 3, 2022

Hi @rmalouf
Thank you for reporting the bug.
The exception throwing mechanism of 0.12.3 seems not to work with Jupyter.
I'll examine it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants