From 16c9a22ae2cbc93e615b999fceadff2e6b800d67 Mon Sep 17 00:00:00 2001 From: huzhaojie Date: Thu, 25 Feb 2021 16:00:20 +0800 Subject: [PATCH 01/11] bpo-43318: pdb can't output the prompt message when successfully clear breakpoints by filename:lineno --- Lib/pdb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/pdb.py b/Lib/pdb.py index 081a8449d41096..ff40f7b2476a38 100755 --- a/Lib/pdb.py +++ b/Lib/pdb.py @@ -893,7 +893,7 @@ def do_clear(self, arg): except ValueError: err = "Invalid line number (%s)" % arg else: - bplist = self.get_breaks(filename, lineno) + bplist = self.get_breaks(filename, lineno)[:] err = self.clear_break(filename, lineno) if err: self.error(err) From aef3abd7be5ce467be1a959045f42dcf62767e06 Mon Sep 17 00:00:00 2001 From: huzhaojie Date: Fri, 26 Feb 2021 15:46:44 +0800 Subject: [PATCH 02/11] add unit test for bpo-43318 --- Lib/test/test_pdb.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py index aa3035b6ac3796..7e2690af4a0c22 100644 --- a/Lib/test/test_pdb.py +++ b/Lib/test/test_pdb.py @@ -1322,6 +1322,34 @@ def test_pdb_issue_20766(): pdb 2: """ +def test_pdb_issue_43318(): + """issue-43318:pdb can't output the prompt message when successfully clear breakpoints by filename:lineno + + >>> def test_function(): + ... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace() + ... print(1) + ... print(2) + ... print(3) + ... print(4) + + >>> with PdbTestInput([ # doctest: +NORMALIZE_WHITESPACE + ... 'break 3', + ... 'clear :3', + ... 'continue' + ... ]): + ... test_function() + > (3)test_function() + -> print(1) + (Pdb) break 3 + Breakpoint 6 at :3 + (Pdb) clear :3 + Deleted breakpoint 6 at :3 + (Pdb) continue + 1 + 2 + 3 + 4 + """ class PdbTestCase(unittest.TestCase): def tearDown(self): From 387e322126798cea4333004231c05697d913455a Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Thu, 25 Feb 2021 08:32:07 +0000 Subject: [PATCH 03/11] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20b?= =?UTF-8?q?lurb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NEWS.d/next/Library/2021-02-25-08-32-06.bpo-43318.bZJw6V.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2021-02-25-08-32-06.bpo-43318.bZJw6V.rst diff --git a/Misc/NEWS.d/next/Library/2021-02-25-08-32-06.bpo-43318.bZJw6V.rst b/Misc/NEWS.d/next/Library/2021-02-25-08-32-06.bpo-43318.bZJw6V.rst new file mode 100644 index 00000000000000..fa56ed80090d3a --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-02-25-08-32-06.bpo-43318.bZJw6V.rst @@ -0,0 +1 @@ +Fix the bug that pdb can't output prompt message when breakpoints are successfully cleared by "filename:lineno". \ No newline at end of file From 693be3fb7078c80c89cccf52ffe354f6e360a10d Mon Sep 17 00:00:00 2001 From: huzhaojie Date: Thu, 22 Apr 2021 14:44:24 +0800 Subject: [PATCH 04/11] fix unit test issue --- 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 7e2690af4a0c22..7e7fb314689922 100644 --- a/Lib/test/test_pdb.py +++ b/Lib/test/test_pdb.py @@ -1331,7 +1331,7 @@ def test_pdb_issue_43318(): ... print(2) ... print(3) ... print(4) - + >>> reset_Breakpoint() >>> with PdbTestInput([ # doctest: +NORMALIZE_WHITESPACE ... 'break 3', ... 'clear :3', @@ -1341,9 +1341,9 @@ def test_pdb_issue_43318(): > (3)test_function() -> print(1) (Pdb) break 3 - Breakpoint 6 at :3 + Breakpoint 1 at :3 (Pdb) clear :3 - Deleted breakpoint 6 at :3 + Deleted breakpoint 1 at :3 (Pdb) continue 1 2 From 49ef2ff6ab6bb3c2962e5622a69c99df70a871a3 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Thu, 22 Apr 2021 08:34:46 +0000 Subject: [PATCH 05/11] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20b?= =?UTF-8?q?lurb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NEWS.d/next/Library/2021-04-22-08-34-46.bpo-43318.Rztyvu.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2021-04-22-08-34-46.bpo-43318.Rztyvu.rst diff --git a/Misc/NEWS.d/next/Library/2021-04-22-08-34-46.bpo-43318.Rztyvu.rst b/Misc/NEWS.d/next/Library/2021-04-22-08-34-46.bpo-43318.Rztyvu.rst new file mode 100644 index 00000000000000..8e4f5c64232303 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-04-22-08-34-46.bpo-43318.Rztyvu.rst @@ -0,0 +1 @@ +Fix pdb can't output prompt message when breakpoints are successfully cleared by (filename, lineno). \ No newline at end of file From fcbeacc6bbf06947e43d3744da9b22b8a5d60df9 Mon Sep 17 00:00:00 2001 From: huzhaojie Date: Fri, 11 Jun 2021 10:56:41 +0800 Subject: [PATCH 06/11] Update Lib/test/test_pdb.py Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> --- Lib/test/test_pdb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py index 7e7fb314689922..b70f52cc20eb34 100644 --- a/Lib/test/test_pdb.py +++ b/Lib/test/test_pdb.py @@ -1323,7 +1323,7 @@ def test_pdb_issue_20766(): """ def test_pdb_issue_43318(): - """issue-43318:pdb can't output the prompt message when successfully clear breakpoints by filename:lineno + """echo breakpoints cleared with filename:lineno >>> def test_function(): ... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace() From 593666acc96e1689e7b4ffbfda89a255ef738670 Mon Sep 17 00:00:00 2001 From: huzhaojie Date: Fri, 11 Jun 2021 11:01:05 +0800 Subject: [PATCH 07/11] Update Misc/NEWS.d/next/Library/2021-02-25-08-32-06.bpo-43318.bZJw6V.rst Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> --- .../next/Library/2021-02-25-08-32-06.bpo-43318.bZJw6V.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Library/2021-02-25-08-32-06.bpo-43318.bZJw6V.rst b/Misc/NEWS.d/next/Library/2021-02-25-08-32-06.bpo-43318.bZJw6V.rst index fa56ed80090d3a..c2c9c8776fd86d 100644 --- a/Misc/NEWS.d/next/Library/2021-02-25-08-32-06.bpo-43318.bZJw6V.rst +++ b/Misc/NEWS.d/next/Library/2021-02-25-08-32-06.bpo-43318.bZJw6V.rst @@ -1 +1 @@ -Fix the bug that pdb can't output prompt message when breakpoints are successfully cleared by "filename:lineno". \ No newline at end of file +Fix a bug where :mod:`pdb` does not always echo cleared breakpoints. From a8e639fae117387d3be979032bf5648c121a48c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=85=86=E6=9D=B0?= Date: Fri, 11 Jun 2021 11:12:53 +0800 Subject: [PATCH 08/11] remove redundant rst file --- .../NEWS.d/next/Library/2021-04-22-08-34-46.bpo-43318.Rztyvu.rst | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Misc/NEWS.d/next/Library/2021-04-22-08-34-46.bpo-43318.Rztyvu.rst diff --git a/Misc/NEWS.d/next/Library/2021-04-22-08-34-46.bpo-43318.Rztyvu.rst b/Misc/NEWS.d/next/Library/2021-04-22-08-34-46.bpo-43318.Rztyvu.rst deleted file mode 100644 index 8e4f5c64232303..00000000000000 --- a/Misc/NEWS.d/next/Library/2021-04-22-08-34-46.bpo-43318.Rztyvu.rst +++ /dev/null @@ -1 +0,0 @@ -Fix pdb can't output prompt message when breakpoints are successfully cleared by (filename, lineno). \ No newline at end of file From 064d426782b449c2e2a72acdad41efc364340e0c Mon Sep 17 00:00:00 2001 From: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Date: Fri, 11 Jun 2021 11:02:04 +0100 Subject: [PATCH 09/11] Fix whitespace --- Lib/test/test_pdb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py index b70f52cc20eb34..33bbc62110446b 100644 --- a/Lib/test/test_pdb.py +++ b/Lib/test/test_pdb.py @@ -1323,7 +1323,7 @@ def test_pdb_issue_20766(): """ def test_pdb_issue_43318(): - """echo breakpoints cleared with filename:lineno + """echo breakpoints cleared with filename:lineno >>> def test_function(): ... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace() From 0577eaefa8886634e0e3b80bc6943a0814702aeb Mon Sep 17 00:00:00 2001 From: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Date: Fri, 11 Jun 2021 11:03:19 +0100 Subject: [PATCH 10/11] Add blank line at end of new test function --- Lib/test/test_pdb.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py index 33bbc62110446b..0f376d4eaf1b8e 100644 --- a/Lib/test/test_pdb.py +++ b/Lib/test/test_pdb.py @@ -1350,6 +1350,7 @@ def test_pdb_issue_43318(): 3 4 """ + class PdbTestCase(unittest.TestCase): def tearDown(self): From df58705edc4e6573b823f1299a4379a838a3a54f Mon Sep 17 00:00:00 2001 From: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Date: Fri, 11 Jun 2021 11:27:56 +0100 Subject: [PATCH 11/11] remove extra spaces --- Lib/test/test_pdb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py index 0f376d4eaf1b8e..0724b666a3bf8d 100644 --- a/Lib/test/test_pdb.py +++ b/Lib/test/test_pdb.py @@ -1350,7 +1350,7 @@ def test_pdb_issue_43318(): 3 4 """ - + class PdbTestCase(unittest.TestCase): def tearDown(self):