Vscode-jupyter: outputPrepend created excessively.

Created on 10 May 2020  路  6Comments  路  Source: microsoft/vscode-jupyter

Bug: Notebook Editor

Steps to cause the bug to occur

  1. Turn on auto-save.
  2. Work with file for an extended period of time.
  3. (Demonstration of problem) Attempt to use nbconvert, or open the file in a different editor.

Actual behavior

Several thousand excess instances of outputPrepend in one cell, a much smaller number of excess instances in a second.

AutomationAnalysis.txt

Expected behavior

  "cell_type": "code",
  "metadata": {
    "tags": [
      "outputPrepend"
    ]

Your Jupyter and/or Python environment

_Please provide as much info as you readily know_

  • Jupyter server running: Local
  • Extension version: 2020.4.76186
  • VS Code version: 1.45
  • Setting python.jediEnabled: Uncertain
  • Python and/or Anaconda version: 3.7.3
  • OS: Windows:
  • Virtual environment: NA

Developer Tools Console Output

It just has a theme: I assume I am missing something.

Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer

bug regression

Most helpful comment

This should be fixed in our insider's build if you want to try it out.
https://pvsc.blob.core.windows.net/extension-builds/ms-python-insiders.vsix

All 6 comments

Thanks for letting us know @khs. Looks like we are just pushing that like crazy.

It could be the recent update. It could be something else. But in the past I've been able to smoothly alternate between opening notebooks in Jupyter and opening them in VSCode, so that is at least my best guess at what the change is.

Has to do with trimming strings. Regression from a couple releases ago.

This is an annoying bug :(

In case that's a useful workaround for some (but use at own risk, I haven't tested it extensively!) to "purge" all the outputPrepends, which make the resulting jupyter notebooks impossible to export to other formats, one can use sed in a linux command line:

# delete outputPrepends, and then get rid of blank lines
sed -e 's/"outputPrepend",//g' broken.ipynb | sed -r '/^\s*$/d' > sanitized.ipynb

or replace the regex "outputPrepend",\n with nothing in VSCode, when visualizing the raw json structure of the "damaged" .ipynb file.

The resulting .ipynb file should pass validations without errors.

This should be fixed in our insider's build if you want to try it out.
https://pvsc.blob.core.windows.net/extension-builds/ms-python-insiders.vsix

Validated just one outputPrepend in the metadata, and file with trimmed output opens in jupyter as well.

Was this page helpful?
0 / 5 - 0 ratings