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

KeyError in get_default_logging_config #723

Closed
tonyroberts opened this issue May 12, 2022 · 1 comment · Fixed by #724
Closed

KeyError in get_default_logging_config #723

tonyroberts opened this issue May 12, 2022 · 1 comment · Fixed by #724

Comments

@tonyroberts
Copy link
Contributor

If sys.executable is set to pythonw.exe calling get_default_logging_config results in a KeyError because it tries to delete a key that doesn't exist.

https://github.com/ipython/traitlets/blob/main/traitlets/config/application.py#L259

2022-05-12 15:42:05,811 - ERROR :   File "C:\Users\tony\miniconda3\envs\py39-7165\lib\site-packages\traitlets\config\application.py", line 259, in get_default_logging_config
2022-05-12 15:42:05,812 - ERROR :     del config["handlers"]["loggers"]
2022-05-12 15:42:05,812 - ERROR : KeyError: 'loggers'
@r-dahlstedt
Copy link

Received the same error. Issue is that the 'del' needs to be two lines, not one:
Original:
del config["handlers"]["loggers"]
Corrected:
del config["handlers"]
del config["loggers"]

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

Successfully merging a pull request may close this issue.

2 participants