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

Jupytext --set-kernel fails in version 1.2.3 on .markdown files #325

Closed
mwouts opened this issue Sep 2, 2019 · 1 comment
Closed

Jupytext --set-kernel fails in version 1.2.3 on .markdown files #325

mwouts opened this issue Sep 2, 2019 · 1 comment
Milestone

Comments

@mwouts
Copy link
Owner

mwouts commented Sep 2, 2019

For instance, jupytext --set-kernel elegant-scipy-kernel markdown/* fails with this message:

[jupytext] Reading markdown/acknowledgements.markdown
[jupytext] Updating notebook metadata with '{"kernelspec": {"name": "elegant-scipy-kernel", "language": "python", "display_name": "elegant-scipy-kernel"}}'
[jupytext] Writing markdown/acknowledgements.markdown in format markdown:markdown (destination file replaced)
[jupytext] Reading markdown/ch1.markdown
[jupytext] Updating notebook metadata with '{"kernelspec": {"name": "elegant-scipy-kernel", "language": "python", "display_name": "elegant-scipy-kernel"}}'
[jupytext] Writing markdown/ch1.markdown in format markdown:markdown (destination file replaced)
[jupytext] Error: unsupported operand type(s) for +: 'NoneType' and 'str'
@mwouts
Copy link
Owner Author

mwouts commented Sep 15, 2019

With the version 1.2.4-dev of Jupytext, the full error is

[jupytext] Reading markdown/acknowledgements.markdown
[jupytext] Updating notebook metadata with '{"kernelspec": {"name": "elegant-scipy-kernel", "language": "python", "display_name": "elegant-scipy-kernel"}}'
[jupytext] Writing markdown/acknowledgements.markdown in format markdown:markdown (destination file replaced)
[jupytext] Reading markdown/ch1.markdown
[jupytext] Updating notebook metadata with '{"kernelspec": {"name": "elegant-scipy-kernel", "language": "python", "display_name": "elegant-scipy-kernel"}}'
[jupytext] Writing markdown/ch1.markdown in format markdown:markdown (destination file replaced)
Traceback (most recent call last):
  File "/home/marc/jupyter-book-experiments/jupytext/jupytext/header.py", line 65, in encoding_and_executable
    cell.source.encode('ascii')
UnicodeEncodeError: 'ascii' codec can't encode character '\u2014' in position 310: ordinal not in range(128)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/marc/miniconda3/envs/python3/bin/jupytext", line 11, in <module>
    load_entry_point('jupytext', 'console_scripts', 'jupytext')()
  File "/home/marc/jupyter-book-experiments/jupytext/jupytext/cli.py", line 228, in jupytext
    exit_code += jupytext_single_file(nb_file, args, log)
  File "/home/marc/jupyter-book-experiments/jupytext/jupytext/cli.py", line 387, in jupytext_single_file
    write(notebook, nb_dest, fmt=dest_fmt)
  File "/home/marc/jupyter-book-experiments/jupytext/jupytext/jupytext.py", line 333, in write
    write(nb, stream, version=version, fmt=fmt, **kwargs)
  File "/home/marc/jupyter-book-experiments/jupytext/jupytext/jupytext.py", line 338, in write
    content = writes(nb, version=version, fmt=fmt, **kwargs)
  File "/home/marc/jupyter-book-experiments/jupytext/jupytext/jupytext.py", line 307, in writes
    return writer.writes(notebook, metadata)
  File "/home/marc/jupyter-book-experiments/jupytext/jupytext/jupytext.py", line 128, in writes
    header = encoding_and_executable(nb, metadata, self.ext)
  File "/home/marc/jupyter-book-experiments/jupytext/jupytext/header.py", line 67, in encoding_and_executable
    lines.append(comment + _UTF8_HEADER)
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

mwouts added a commit that referenced this issue Sep 15, 2019
mwouts added a commit that referenced this issue Sep 15, 2019
mwouts added a commit that referenced this issue Sep 16, 2019
@mwouts mwouts mentioned this issue Sep 16, 2019
@mwouts mwouts changed the title Jupytext --set-kernel fails in version 1.2.3 Jupytext --set-kernel fails in version 1.2.3 on .markdown files Sep 16, 2019
@mwouts mwouts closed this as completed in 5c3f5c4 Sep 17, 2019
mwouts added a commit that referenced this issue Sep 17, 2019
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

No branches or pull requests

1 participant