From 16a603c81b6ad9d6095de246ee177609f5026123 Mon Sep 17 00:00:00 2001 From: David Brochart Date: Mon, 30 May 2022 12:07:00 +0200 Subject: [PATCH 1/4] Fix richInspectVariables --- ipykernel/debugger.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ipykernel/debugger.py b/ipykernel/debugger.py index 841966a72..11ccfb68c 100644 --- a/ipykernel/debugger.py +++ b/ipykernel/debugger.py @@ -26,7 +26,10 @@ SuspendedFramesManager, _FramesTracker, ) + from _pydevd_bundle.pydevd_safe_repr import SafeRepr # isort: skip + SafeRepr.maxstring_inner = 2**16 + SafeRepr.maxother_inner = 2**16 _is_debugpy_available = True except ImportError: _is_debugpy_available = False From e50ee827a03b8c4bb07ac529081fc2e6f085636d Mon Sep 17 00:00:00 2001 From: David Brochart Date: Thu, 2 Jun 2022 18:46:00 +0200 Subject: [PATCH 2/4] Use 'context':'clipboard' to prevent string stripping --- ipykernel/debugger.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ipykernel/debugger.py b/ipykernel/debugger.py index 11ccfb68c..7d0f3054e 100644 --- a/ipykernel/debugger.py +++ b/ipykernel/debugger.py @@ -26,10 +26,7 @@ SuspendedFramesManager, _FramesTracker, ) - from _pydevd_bundle.pydevd_safe_repr import SafeRepr # isort: skip - SafeRepr.maxstring_inner = 2**16 - SafeRepr.maxother_inner = 2**16 _is_debugpy_available = True except ImportError: _is_debugpy_available = False @@ -598,7 +595,7 @@ async def richInspectVariables(self, message): "type": "request", "command": "evaluate", "seq": seq + 1, - "arguments": {"expression": code, "frameId": frame_id}, + "arguments": {"expression": code, "frameId": frame_id, "context": "clipboard"}, } ) if reply["success"]: From 448e16bbb8903540352ef1b03a4fd054271b84e6 Mon Sep 17 00:00:00 2001 From: David Brochart Date: Fri, 3 Jun 2022 21:26:45 +0200 Subject: [PATCH 3/4] - --- ipykernel/debugger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipykernel/debugger.py b/ipykernel/debugger.py index 7d0f3054e..841966a72 100644 --- a/ipykernel/debugger.py +++ b/ipykernel/debugger.py @@ -595,7 +595,7 @@ async def richInspectVariables(self, message): "type": "request", "command": "evaluate", "seq": seq + 1, - "arguments": {"expression": code, "frameId": frame_id, "context": "clipboard"}, + "arguments": {"expression": code, "frameId": frame_id}, } ) if reply["success"]: From 9e4fa350b8ef0c74bcab977b3e0dd07d6c635687 Mon Sep 17 00:00:00 2001 From: David Brochart Date: Fri, 3 Jun 2022 21:44:15 +0200 Subject: [PATCH 4/4] Re-apply changes --- ipykernel/debugger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipykernel/debugger.py b/ipykernel/debugger.py index 841966a72..7d0f3054e 100644 --- a/ipykernel/debugger.py +++ b/ipykernel/debugger.py @@ -595,7 +595,7 @@ async def richInspectVariables(self, message): "type": "request", "command": "evaluate", "seq": seq + 1, - "arguments": {"expression": code, "frameId": frame_id}, + "arguments": {"expression": code, "frameId": frame_id, "context": "clipboard"}, } ) if reply["success"]: