From 349779cc8f4e9f42fd5048f2b3df6ce5d08038ed Mon Sep 17 00:00:00 2001 From: Irit Katriel Date: Mon, 31 Aug 2020 20:32:27 +0100 Subject: [PATCH 1/7] bpo-26053: Fix args echoed by pdb run command --- Lib/pdb.py | 2 +- Lib/test/test_pdb.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Lib/pdb.py b/Lib/pdb.py index d7d957159458be..811b2a3b1b8084 100755 --- a/Lib/pdb.py +++ b/Lib/pdb.py @@ -1707,7 +1707,7 @@ def main(): print("The program finished and will be restarted") except Restart: print("Restarting", mainpyfile, "with arguments:") - print("\t" + " ".join(args)) + print("\t" + " ".join(sys.argv[1:])) except SystemExit: # In most cases SystemExit does not warrant a post-mortem session. print("The program exited via sys.exit(). Exit status:", end=' ') diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py index e56451360d6438..e8c3c468a3968f 100644 --- a/Lib/test/test_pdb.py +++ b/Lib/test/test_pdb.py @@ -1443,6 +1443,19 @@ def test_issue16180(self): 'Fail to handle a syntax error in the debuggee.' .format(expected, stdout)) + def test_issue26053(self): + # run command of pdb prompt echoes the correct args + script = "print('hello')" + commands = """ + continue + run a b c + run d e f + quit + """ + stdout, stderr = self.run_pdb_script(script, commands) + output = ';'.join([x.strip() for x in stdout.splitlines()]) + self.assertIn("Restarting main.py with arguments:;a b c", output) + self.assertIn("Restarting main.py with arguments:;d e f", output) def test_readrc_kwarg(self): script = textwrap.dedent(""" From e3e032f2fedf1bda38108a989a61fe02d17b37a7 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Mon, 31 Aug 2020 19:42:21 +0000 Subject: [PATCH 2/7] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NEWS.d/next/Library/2020-08-31-19-42-20.bpo-26053.cEwkIY.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2020-08-31-19-42-20.bpo-26053.cEwkIY.rst diff --git a/Misc/NEWS.d/next/Library/2020-08-31-19-42-20.bpo-26053.cEwkIY.rst b/Misc/NEWS.d/next/Library/2020-08-31-19-42-20.bpo-26053.cEwkIY.rst new file mode 100644 index 00000000000000..786fd469cd0906 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-08-31-19-42-20.bpo-26053.cEwkIY.rst @@ -0,0 +1 @@ +Fix args echoed by the pdb prompt's 'run' command. \ No newline at end of file From 653ffb48c261fadbd8e9f3f7ffcf6988a68b8db6 Mon Sep 17 00:00:00 2001 From: Irit Katriel Date: Tue, 1 Sep 2020 10:12:38 +0100 Subject: [PATCH 3/7] Update 2020-08-31-19-42-20.bpo-26053.cEwkIY.rst --- .../next/Library/2020-08-31-19-42-20.bpo-26053.cEwkIY.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Library/2020-08-31-19-42-20.bpo-26053.cEwkIY.rst b/Misc/NEWS.d/next/Library/2020-08-31-19-42-20.bpo-26053.cEwkIY.rst index 786fd469cd0906..58d4dc8232af8e 100644 --- a/Misc/NEWS.d/next/Library/2020-08-31-19-42-20.bpo-26053.cEwkIY.rst +++ b/Misc/NEWS.d/next/Library/2020-08-31-19-42-20.bpo-26053.cEwkIY.rst @@ -1 +1 @@ -Fix args echoed by the pdb prompt's 'run' command. \ No newline at end of file +Fix args echoed by the pdb prompt run command. From b70fade7b91d0b14f3563a7fbf9c3af985f929a1 Mon Sep 17 00:00:00 2001 From: Irit Katriel Date: Tue, 1 Sep 2020 10:47:45 +0100 Subject: [PATCH 4/7] Delete 2020-08-31-19-42-20.bpo-26053.cEwkIY.rst --- .../NEWS.d/next/Library/2020-08-31-19-42-20.bpo-26053.cEwkIY.rst | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Misc/NEWS.d/next/Library/2020-08-31-19-42-20.bpo-26053.cEwkIY.rst diff --git a/Misc/NEWS.d/next/Library/2020-08-31-19-42-20.bpo-26053.cEwkIY.rst b/Misc/NEWS.d/next/Library/2020-08-31-19-42-20.bpo-26053.cEwkIY.rst deleted file mode 100644 index 58d4dc8232af8e..00000000000000 --- a/Misc/NEWS.d/next/Library/2020-08-31-19-42-20.bpo-26053.cEwkIY.rst +++ /dev/null @@ -1 +0,0 @@ -Fix args echoed by the pdb prompt run command. From b01945d7c2f43f4d3485617b6acd6d62d5c37a23 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Tue, 1 Sep 2020 10:12:14 +0000 Subject: [PATCH 5/7] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NEWS.d/next/Library/2020-09-01-10-12-13.bpo-26053.hXikw_.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2020-09-01-10-12-13.bpo-26053.hXikw_.rst diff --git a/Misc/NEWS.d/next/Library/2020-09-01-10-12-13.bpo-26053.hXikw_.rst b/Misc/NEWS.d/next/Library/2020-09-01-10-12-13.bpo-26053.hXikw_.rst new file mode 100644 index 00000000000000..81114b1bc9d406 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-09-01-10-12-13.bpo-26053.hXikw_.rst @@ -0,0 +1 @@ +Fixed args echoed by the pdb interactive run command. \ No newline at end of file From abc68fe0d49dd95ae48dc9d8588ce7a92c9828a7 Mon Sep 17 00:00:00 2001 From: Irit Katriel Date: Tue, 8 Sep 2020 09:47:53 +0100 Subject: [PATCH 6/7] Update 2020-09-01-10-12-13.bpo-26053.hXikw_.rst --- .../next/Library/2020-09-01-10-12-13.bpo-26053.hXikw_.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Library/2020-09-01-10-12-13.bpo-26053.hXikw_.rst b/Misc/NEWS.d/next/Library/2020-09-01-10-12-13.bpo-26053.hXikw_.rst index 81114b1bc9d406..e8720ac82ffb13 100644 --- a/Misc/NEWS.d/next/Library/2020-09-01-10-12-13.bpo-26053.hXikw_.rst +++ b/Misc/NEWS.d/next/Library/2020-09-01-10-12-13.bpo-26053.hXikw_.rst @@ -1 +1 @@ -Fixed args echoed by the pdb interactive run command. \ No newline at end of file +Fixed bug where the :mod:`pdb` interactive run command echoed the args from the shell command line, even if those have been overridden at the pdb prompt. From c3c468f6107dce0b858cd8162687a4cb4754670c Mon Sep 17 00:00:00 2001 From: Irit Katriel Date: Thu, 5 Nov 2020 11:22:17 +0000 Subject: [PATCH 7/7] ';' --> '\n' in test --- Lib/test/test_pdb.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py index e8c3c468a3968f..cd181b17283481 100644 --- a/Lib/test/test_pdb.py +++ b/Lib/test/test_pdb.py @@ -1453,9 +1453,9 @@ def test_issue26053(self): quit """ stdout, stderr = self.run_pdb_script(script, commands) - output = ';'.join([x.strip() for x in stdout.splitlines()]) - self.assertIn("Restarting main.py with arguments:;a b c", output) - self.assertIn("Restarting main.py with arguments:;d e f", output) + output = '\n'.join([x.strip() for x in stdout.splitlines()]) + self.assertIn("Restarting main.py with arguments:\na b c", output) + self.assertIn("Restarting main.py with arguments:\nd e f", output) def test_readrc_kwarg(self): script = textwrap.dedent("""