Skip to content

Remove dead json_clean / jsonutil module#1503

Draft
erikgaas wants to merge 1 commit intoipython:mainfrom
erikgaas:remove-json-clean
Draft

Remove dead json_clean / jsonutil module#1503
erikgaas wants to merge 1 commit intoipython:mainfrom
erikgaas:remove-json-clean

Conversation

@erikgaas
Copy link
Copy Markdown

@erikgaas erikgaas commented Mar 6, 2026

Summary

Some preliminary exploration trying to get more up to speed with the codebase.

json_clean() has been a no-op since jupyter_client >= 7 (released 2021). Since ipykernel now requires jupyter_client>=8.8.0, this code can never execute.

Changes

  • Remove ipykernel/jsonutil.py entirely
  • Remove all json_clean() call sites in kernelbase.py (7 calls + import)
  • Remove tests/test_jsonutil.py (all tests were already skipIf(jupyter_client >= 7))

No behavioral change — every removed json_clean() call was returning its input unchanged.

Comment thread ipykernel/jsonutil.py
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.

import math
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused imports

@Carreau Carreau added this to the 7.3 milestone May 7, 2026
@Carreau
Copy link
Copy Markdown
Member

Carreau commented May 7, 2026

I like that ! Apparently there are similar utils in jupyter_client (and the one from jupyter_client is used in jupyter_server). Those should also likely go through a cycle of deprecation/removal !

Thanks, (rebasing to try to get tests to pass)

@Carreau Carreau force-pushed the remove-json-clean branch from 1479775 to 3caca68 Compare May 7, 2026 08:38
@Carreau
Copy link
Copy Markdown
Member

Carreau commented May 7, 2026

ipyparallel will need fixeed it imports json clean from ipykernel. (changing to draft, if you or someone else want to send a fix to ipyparallel)

@Carreau Carreau marked this pull request as draft May 7, 2026 08:55
@Carreau Carreau removed this from the 7.3 milestone May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants