From a9c5e02a1afc101ef50cfc94197d5da3e776a86a Mon Sep 17 00:00:00 2001 From: Min RK Date: Fri, 30 Apr 2021 12:29:12 +0200 Subject: [PATCH 1/2] remove use of deprecated pipes module pipes.quote is actually an alias to shlex.quote deprecated by PEP 594, to be removed in 3.10 --- IPython/lib/editorhooks.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/IPython/lib/editorhooks.py b/IPython/lib/editorhooks.py index 7ce0577a091..d8bd6ac81bc 100644 --- a/IPython/lib/editorhooks.py +++ b/IPython/lib/editorhooks.py @@ -6,7 +6,6 @@ """ import os -import pipes import shlex import subprocess import sys @@ -47,9 +46,9 @@ def install_editor(template, wait=False): def call_editor(self, filename, line=0): if line is None: line = 0 - cmd = template.format(filename=pipes.quote(filename), line=line) + cmd = template.format(filename=shlex.quote(filename), line=line) print(">", cmd) - # pipes.quote doesn't work right on Windows, but it does after splitting + # shlex.quote doesn't work right on Windows, but it does after splitting if sys.platform.startswith('win'): cmd = shlex.split(cmd) proc = subprocess.Popen(cmd, shell=True) From 9741a8b1a4c647ad097066bc751a8e0968b9e87e Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Fri, 30 Apr 2021 15:23:25 -0700 Subject: [PATCH 2/2] run darker with new version of black --- IPython/core/magics/script.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IPython/core/magics/script.py b/IPython/core/magics/script.py index d713a7f95f8..d4e7b08c3c1 100644 --- a/IPython/core/magics/script.py +++ b/IPython/core/magics/script.py @@ -213,7 +213,7 @@ async def _stream_communicate(process, cell): *cmd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE, - stdin=asyncio.subprocess.PIPE + stdin=asyncio.subprocess.PIPE, ) ) except OSError as e: