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

outputPrepend created excessively. #1738

Closed
khs opened this issue May 10, 2020 · 6 comments
Closed

outputPrepend created excessively. #1738

khs opened this issue May 10, 2020 · 6 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@khs
Copy link

khs commented May 10, 2020

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

@DavidKutu
Copy link

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

@khs
Copy link
Author

khs commented May 12, 2020

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.

@greazer
Copy link
Member

greazer commented May 14, 2020

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

rchiodo referenced this issue in microsoft/vscode-python May 18, 2020
… each cell execute. (#11871)

* Fixes bugs #11777 and #11726

Changed 'outputPrepend' to be a per 'execution' tag instead of a per 'session' tag.  Once it got saved in the ipynb file, it never went away, thus always showing the truncation message.  All fixed an egregious spelling error.

* Fixes bugs #11777 and #11726

Changed 'outputPrepend' to be a per 'execution' tag instead of a per 'session' tag.  Once it got saved in the ipynb file, it never went away, thus always showing the truncation message.  All fixed an egregious spelling error.
@davidefiocco
Copy link

davidefiocco commented May 28, 2020

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.

@rchiodo
Copy link
Contributor

rchiodo commented May 28, 2020

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

@IanMatthewHuff IanMatthewHuff self-assigned this Jun 2, 2020
@IanMatthewHuff
Copy link
Member

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

@DonJayamanne DonJayamanne transferred this issue from microsoft/vscode-python Nov 13, 2020
@DonJayamanne DonJayamanne added bug Issue identified by VS Code Team member as probable bug reason-regression labels Nov 13, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

7 participants