When I load a file that has a cell tagged with active-py and then save it, Jupytext strips the leading # on comments in the cell, making the cell no longer run correctly in the .py file.
2. Run `jupyter notebook` in the directory where you saved `foo.py` and open `foo.py`.
3. Hit Ctrl+S or Cmd+S to save the file.
# Expected behavior
The file foo.py is unchanged.
# Actual behavior
The line
Print goodbye
in foo.py changes to
Print goodbye
which makes the file no longer runnable (not valid Python code).
# System info
macOS 13.3.1
Python 3.11.5
jupytext 1.15.2
Also repros on:
Rocky Linux 8.8
Python 3.8.17
jupytext 1.5.2
Summary
When I load a file that has a cell tagged with
active-py
and then save it, Jupytext strips the leading#
on comments in the cell, making the cell no longer run correctly in the .py file.To reproduce
foo.py
:%%
print('hello')
%% tags=["active-py"]
Print goodbye
print('goodbye')
Print goodbye
Print goodbye