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

%fetchfromfile saved file is empty due to TypeError #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jej
Copy link

@jej jej commented Dec 19, 2020

I got this error under python 3.8:

[IPKernelApp] ERROR | Exception in message handler:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/ipykernel/kernelbase.py", line 264, in dispatch_shell
    yield gen.maybe_future(handler(stream, idents, msg))
  File "/usr/local/lib/python3.8/dist-packages/tornado/gen.py", line 762, in run
    value = future.result()
  File "/usr/local/lib/python3.8/dist-packages/tornado/gen.py", line 234, in wrapper
    yielded = ctx_run(next, result)
  File "/usr/local/lib/python3.8/dist-packages/ipykernel/kernelbase.py", line 539, in execute_request
    self.do_execute(
  File "/home/user/.local/share/jupyter/jupyter_micropython_kernel/jupyter_micropython_kernel/kernel.py", line 590, in do_execute
    set_next_input_payload = self.sendcommand(code)
  File "/home/user/.local/share/jupyter/jupyter_micropython_kernel/jupyter_micropython_kernel/kernel.py", line 498, in sendcommand
    cellcontents = self.interpretpercentline(mpercentline.group(1), cellcontents[mpercentline.end():])   # discards the %command and a single blank line (if there is one) from the cell contents
  File "/home/user/.local/share/jupyter/jupyter_micropython_kernel/jupyter_micropython_kernel/kernel.py", line 388, in interpretpercentline
    fout.write(fetchedcontents)
TypeError: write() argument must be str, not bytes

I solved it by type cast. I hope it's ok for compatibility.

I got this error under python 3.8:

[IPKernelApp] ERROR | Exception in message handler:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/ipykernel/kernelbase.py", line 264, in dispatch_shell
    yield gen.maybe_future(handler(stream, idents, msg))
  File "/usr/local/lib/python3.8/dist-packages/tornado/gen.py", line 762, in run
    value = future.result()
  File "/usr/local/lib/python3.8/dist-packages/tornado/gen.py", line 234, in wrapper
    yielded = ctx_run(next, result)
  File "/usr/local/lib/python3.8/dist-packages/ipykernel/kernelbase.py", line 539, in execute_request
    self.do_execute(
  File "/home/user/.local/share/jupyter/jupyter_micropython_kernel/jupyter_micropython_kernel/kernel.py", line 590, in do_execute
    set_next_input_payload = self.sendcommand(code)
  File "/home/user/.local/share/jupyter/jupyter_micropython_kernel/jupyter_micropython_kernel/kernel.py", line 498, in sendcommand
    cellcontents = self.interpretpercentline(mpercentline.group(1), cellcontents[mpercentline.end():])   # discards the %command and a single blank line (if there is one) from the cell contents
  File "/home/user/.local/share/jupyter/jupyter_micropython_kernel/jupyter_micropython_kernel/kernel.py", line 388, in interpretpercentline
    fout.write(fetchedcontents)
TypeError: write() argument must be str, not bytes

I solved it by type cast. I hope it's ok for compatibility.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant