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

No way to disable traceback colors when executing notebook #2099

Open
dionhaefner opened this issue Jan 19, 2024 · 0 comments
Open

No way to disable traceback colors when executing notebook #2099

dionhaefner opened this issue Jan 19, 2024 · 0 comments

Comments

@dionhaefner
Copy link

Reproducer:

  1. Jupyter notebook with a single cell that throws an exception:
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "assert False"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}

(foo.ipynb)

  1. Run nbconvert --execute and pipe to a file:
$ jupyter nbconvert --to notebook --execute foo.ipynb > foo.txt 2>&1
  1. foo.txt contains raw escape codes (ANSI terminal colors):
[NbConvertApp] Converting notebook foo.ipynb to notebook
<snip>
nbclient.exceptions.CellExecutionError: An error occurred while executing the following cell:
------------------
assert False
------------------


�[0;31m---------------------------------------------------------------------------�[0m
�[0;31mAssertionError�[0m                            Traceback (most recent call last)
Cell �[0;32mIn[1], line 1�[0m
�[0;32m----> 1�[0m �[38;5;28;01massert�[39;00m �[38;5;28;01mFalse�[39;00m

�[0;31mAssertionError�[0m: 

This makes our server logs unreadable and makes it harder for users to find out why notebook execution failed.

Is there any way to disable traceback coloring?

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