Recently, I’ve noticed a perplexing problem: whenever I attempt to input digits as part of user input, the cell type automatically changes, as if the numbers are being interpreted as shortcuts to modify cell types.
In an effort to troubleshoot, I have reinstalled both Jupyter Notebook, restarted my Windows system, and even opened my code in a new file. Unfortunately, none of these steps have resolved the issue. Despite extensive research online, I have been unable to find any information suggesting that this behavior is normal or expected.
At this point, I am beginning to suspect that this might be a bug within Jupyter Notebook itself. However, I am unsure of how to proceed in troubleshooting or resolving it.
If any members of the community have experienced a similar problem or have any insights or suggestions on how to address it, I would be immensely grateful for your assistance.
1 Like
I know what problem you are facing. There were patches for that I authored that were released a few weeks back.
- Which version of JupyterLab/Jupyter Notebook do you have installed?
- If the answer for the above is 4.1.5 / 7.1.2, can you share a full reproducer (what kind of an input do you work with, code to create the input).
- If the answer is older version, can you upgade, test, and if it still provide a reproducer?
Also, Preventing changing cell type when input is pending to avoid kernel deadlock by krassowski · Pull Request #16032 · jupyterlab/jupyterlab · GitHub that you can test in JupyterLab 4.2.0a2 will prevent changing cell type(including by digit shortcuts) when input is pending - but this only pertains to input requested using native kernel mechanisms, such as using Python’s input()
or getpass()
methods (if you use a third-party widgets library it may not be relevant).
Hi, I am having this same issue in Jupyter Notebook 7.2.2 on Windows Server 2019, Python 3.9.18. The text field of requested user input changes the cell type when I input certain digits.
My sample code is:
import getpass as gp
pw = gp.getpass(“Password:”)
Results I have noticed are:
Input 1: adds a # symbol to the first line of the cell and changes the cell type to markdown
Input 2: adds 2 # symbols and changes the cell type to markdown
Input 3: adds three #s etc
Input 4: adds four…
etc.
So it looks like what happens is that it adds the number of # symbols to comment out the first line in the code cell and changes the code cell type to markdown.
If it is the same issue as in this thread and/or here & elsewhere, did you try the solutions offered?
Thanks! I uninstalled jupyter and did a fresh install and it now works fine.
This also fixed other problems with my previous installation, such as shortcut keys (cell type changing using esc-d, esc-y etc.) not working.
1 Like