mwouts / itables

Pandas DataFrames as Interactive DataTables
https://mwouts.github.io/itables/
MIT License
710 stars 53 forks source link

UnicodeDecodeError while set "connected=False" #285

Closed Samox1 closed 3 weeks ago

Samox1 commented 3 weeks ago

I encountered a problem the first time I ran in jupyter notebook - the file contains only:

from itables import init_notebook_mode
init_notebook_mode(all_interactive=True, connected=False)

Error:

UnicodeDecodeError                        Traceback (most recent call last)
Cell In[3], [line 2](vscode-notebook-cell:?execution_count=3&line=2)
      [1] from itables import init_notebook_mode
----> [2] init_notebook_mode(all_interactive=True, connected=False)

[...]

File ~\AppData\Local\Programs\Python\Python310\lib\encodings\cp1250.py:23, in IncrementalDecoder.decode(self, input, final)
     [22] def decode(self, input, final=False):
---> [23]     return codecs.charmap_decode(input,self.errors,decoding_table)[0]

UnicodeDecodeError: 'charmap' codec can't decode byte 0x83 in position 194869: character maps to <undefined>

When set "connected=True" everything works properly.

itables version 2.1.0

mwouts commented 3 weeks ago

Hi @Samox1 , thank you for reporting this! This problem was initially reported at #252 and I have a PR ready to be tested in #253, but I could never reproduce the issue myself so I'd like to get confirmation that it does solve the issue before merging.

Do you think you could try the instruction here to test the PR? You will have to install nodejs. If that does not work for you let me know and I will publish a release candidate.

mwouts commented 3 weeks ago

Actually I have just released itables=2.1.1 with the fix. Let me know how it goes.

Samox1 commented 3 weeks ago

Oh sorry, I looked for this problem in Issues but couldn't find it, that's why I described the problem.

I will check this issue in the near future and let you know.

mwouts commented 3 weeks ago

No problem at all! Thanks for reporting the issue. Sure, keep me posted!

Samox1 commented 3 weeks ago

Tested on new venv - init_notebook_mode(all_interactive=True, connected=False) works without issue - really love this simple view!

Tested on: Windows 10 / Python 3.10.7 / ipynb in VS Code