Skip to content

gh-79871: IDLE - Fix and test debugger module #11451

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 51 commits into from
Nov 19, 2023

Conversation

tonybaloney
Copy link
Contributor

@tonybaloney tonybaloney commented Jan 6, 2019

Add docstrings to the debugger module. Fix two bugs: initialize Idb.botframe (should be in Bdb); In Idb.in_rpc_code, check whether prev_frame is None before trying to use it. Make other code changes.

Expand test_debugger from nearly nothing.

@tonybaloney
Copy link
Contributor Author

Also requesting review from @csabella

@tonybaloney
Copy link
Contributor Author

I'm going to continue merging tests into this PR instead of opening separate ones

…the '.reset()' method. This method is never called, so the attribute does not exist and under certain situations, could crash the debugger window
@tonybaloney
Copy link
Contributor Author

just realised I've been writing these all as pytest assertions. Will amend existing commits

@terryjreedy terryjreedy changed the title bpo-35668: Add tests to idle_test for idlelib.debugger.Idb bpo-35668: Add fix and tests for idlelib.debugger.Idb Jan 7, 2019
@tonybaloney
Copy link
Contributor Author

@terryjreedy I'm still adding tests so this isn't ready for review yet. But early feedback would be welcome as this is my first foray into the idle_test suite

@terryjreedy
Copy link
Member

Yes, additional debugger tests should go here.

@tonybaloney
Copy link
Contributor Author

@terryjreedy I've finished the test suite. There is quite a heavy use of mock, but mostly to isolate the behaviours and validate that the methods call the underlying components with the correct values.

I've also created a class in here as a reflection of types.FrameType which is used many times, as well as a small piece of code, which is compiled.
This is to create a frame and a code object, to simulate as much as possible (without popping up a subinterpreter) the debugging process.

Something I saw a lot but wasn't sure why it existed, where these empty single-line comments. https://github.com/python/cpython/pull/11451/files#diff-6428b52d9491cd87d1aaac56558bdd7bL235 do you know what they're for? I assumed to break up the large functions, but empty lines are normally used for that. I've never come across it before and wondered if there was a reason.

@tonybaloney tonybaloney changed the title bpo-35668: Add fix and tests for idlelib.debugger.Idb bpo-35668: Add fix and tests for idlelib.debugger module Jan 7, 2019
@python python deleted a comment from bedevere-bot Nov 19, 2023
@python python deleted a comment from bedevere-bot Nov 19, 2023
@python python deleted a comment from bedevere-bot Nov 19, 2023
@python python deleted a comment from bedevere-bot Nov 19, 2023
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot aarch64 Fedora Stable Clang Installed 3.11 has failed when building commit e19d75d.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/1004/builds/1032) and take a look at the build logs.
  4. Check if the failure is related to this commit (e19d75d) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/1004/builds/1032

Failed tests:

  • test_idle

Failed subtests:

  • setUpClass - idlelib.idle_test.test_debugger.NameSpaceTest

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.11.cstratak-fedora-stable-aarch64.clang-installed/build/target/lib/python3.11/idlelib/idle_test/test_debugger.py", line 282, in setUpClass
    cls.root = Tk()
               ^^^^
  File "/home/buildbot/buildarea/3.11.cstratak-fedora-stable-aarch64.clang-installed/build/target/lib/python3.11/tkinter/__init__.py", line 2326, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_tkinter.TclError: no display name and no $DISPLAY environment variable

@python python deleted a comment from bedevere-bot Nov 19, 2023
@python python deleted a comment from bedevere-bot Nov 19, 2023
@python python deleted a comment from bedevere-bot Nov 19, 2023
@python python deleted a comment from bedevere-bot Nov 19, 2023
@python python deleted a comment from bedevere-bot Nov 19, 2023
@python python deleted a comment from bedevere-bot Nov 19, 2023
@python python deleted a comment from bedevere-bot Nov 19, 2023
@python python deleted a comment from bedevere-bot Nov 19, 2023
@python python deleted a comment from bedevere-bot Nov 19, 2023
@python python deleted a comment from bedevere-bot Nov 19, 2023
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Fedora Stable LTO 3.11 has failed when building commit e19d75d.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/956/builds/934) and take a look at the build logs.
  4. Check if the failure is related to this commit (e19d75d) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/956/builds/934

Failed tests:

  • test_idle

Failed subtests:

  • setUpClass - idlelib.idle_test.test_debugger.NameSpaceTest

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.11.cstratak-fedora-stable-x86_64.lto/build/Lib/idlelib/idle_test/test_debugger.py", line 282, in setUpClass
    cls.root = Tk()
               ^^^^
  File "/home/buildbot/buildarea/3.11.cstratak-fedora-stable-x86_64.lto/build/Lib/tkinter/__init__.py", line 2326, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_tkinter.TclError: no display name and no $DISPLAY environment variable

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x Fedora Clang 3.11 has failed when building commit e19d75d.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/953/builds/1051) and take a look at the build logs.
  4. Check if the failure is related to this commit (e19d75d) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/953/builds/1051

Failed tests:

  • test_idle

Failed subtests:

  • setUpClass - idlelib.idle_test.test_debugger.NameSpaceTest

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.11.edelsohn-fedora-z.clang/build/Lib/idlelib/idle_test/test_debugger.py", line 282, in setUpClass
    cls.root = Tk()
               ^^^^
  File "/home/dje/cpython-buildarea/3.11.edelsohn-fedora-z.clang/build/Lib/tkinter/__init__.py", line 2326, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_tkinter.TclError: no display name and no $DISPLAY environment variable

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot aarch64 RHEL8 LTO + PGO 3.12 has failed when building commit a62dcac.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/1188/builds/423) and take a look at the build logs.
  4. Check if the failure is related to this commit (a62dcac) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/1188/builds/423

Failed tests:

  • test_idle

Failed subtests:

  • setUpClass - idlelib.idle_test.test_debugger.NameSpaceTest

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.12.cstratak-RHEL8-aarch64.lto-pgo/build/Lib/idlelib/idle_test/test_debugger.py", line 282, in setUpClass
    cls.root = Tk()
               ^^^^
  File "/home/buildbot/buildarea/3.12.cstratak-RHEL8-aarch64.lto-pgo/build/Lib/tkinter/__init__.py", line 2326, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_tkinter.TclError: no display name and no $DISPLAY environment variable

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x Fedora Clang Installed 3.11 has failed when building commit e19d75d.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/958/builds/1055) and take a look at the build logs.
  4. Check if the failure is related to this commit (e19d75d) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/958/builds/1055

Failed tests:

  • test_idle

Failed subtests:

  • setUpClass - idlelib.idle_test.test_debugger.NameSpaceTest

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.11.edelsohn-fedora-z.clang-installed/build/target/lib/python3.11/idlelib/idle_test/test_debugger.py", line 282, in setUpClass
    cls.root = Tk()
               ^^^^
  File "/home/dje/cpython-buildarea/3.11.edelsohn-fedora-z.clang-installed/build/target/lib/python3.11/tkinter/__init__.py", line 2326, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_tkinter.TclError: no display name and no $DISPLAY environment variable

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot aarch64 RHEL8 LTO 3.12 has failed when building commit a62dcac.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/1127/builds/427) and take a look at the build logs.
  4. Check if the failure is related to this commit (a62dcac) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/1127/builds/427

Failed tests:

  • test_idle

Failed subtests:

  • setUpClass - idlelib.idle_test.test_debugger.NameSpaceTest

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.12.cstratak-RHEL8-aarch64.lto/build/Lib/idlelib/idle_test/test_debugger.py", line 282, in setUpClass
    cls.root = Tk()
               ^^^^
  File "/home/buildbot/buildarea/3.12.cstratak-RHEL8-aarch64.lto/build/Lib/tkinter/__init__.py", line 2326, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_tkinter.TclError: no display name and no $DISPLAY environment variable

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x Fedora LTO + PGO 3.11 has failed when building commit e19d75d.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/1023/builds/1049) and take a look at the build logs.
  4. Check if the failure is related to this commit (e19d75d) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/1023/builds/1049

Failed tests:

  • test_idle

Failed subtests:

  • setUpClass - idlelib.idle_test.test_debugger.NameSpaceTest

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.11.edelsohn-fedora-z.lto-pgo/build/Lib/idlelib/idle_test/test_debugger.py", line 282, in setUpClass
    cls.root = Tk()
               ^^^^
  File "/home/dje/cpython-buildarea/3.11.edelsohn-fedora-z.lto-pgo/build/Lib/tkinter/__init__.py", line 2326, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_tkinter.TclError: no display name and no $DISPLAY environment variable

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot aarch64 Fedora Stable LTO + PGO 3.11 has failed when building commit e19d75d.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/984/builds/1031) and take a look at the build logs.
  4. Check if the failure is related to this commit (e19d75d) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/984/builds/1031

Failed tests:

  • test_idle

Failed subtests:

  • setUpClass - idlelib.idle_test.test_debugger.NameSpaceTest

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.11.cstratak-fedora-stable-aarch64.lto-pgo/build/Lib/idlelib/idle_test/test_debugger.py", line 282, in setUpClass
    cls.root = Tk()
               ^^^^
  File "/home/buildbot/buildarea/3.11.cstratak-fedora-stable-aarch64.lto-pgo/build/Lib/tkinter/__init__.py", line 2326, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_tkinter.TclError: no display name and no $DISPLAY environment variable

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x Fedora LTO 3.11 has failed when building commit e19d75d.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/975/builds/954) and take a look at the build logs.
  4. Check if the failure is related to this commit (e19d75d) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/975/builds/954

Failed tests:

  • test_idle

Failed subtests:

  • setUpClass - idlelib.idle_test.test_debugger.NameSpaceTest

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.11.edelsohn-fedora-z.lto/build/Lib/idlelib/idle_test/test_debugger.py", line 282, in setUpClass
    cls.root = Tk()
               ^^^^
  File "/home/dje/cpython-buildarea/3.11.edelsohn-fedora-z.lto/build/Lib/tkinter/__init__.py", line 2326, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_tkinter.TclError: no display name and no $DISPLAY environment variable

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot PPC64LE RHEL8 LTO + PGO 3.x has failed when building commit adedcfa.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/458/builds/4308) and take a look at the build logs.
  4. Check if the failure is related to this commit (adedcfa) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/458/builds/4308

Failed tests:

  • test_idle

Failed subtests:

  • setUpClass - idlelib.idle_test.test_debugger.NameSpaceTest

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-ppc64le.lto-pgo/build/Lib/idlelib/idle_test/test_debugger.py", line 282, in setUpClass
    cls.root = Tk()
               ^^^^
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-ppc64le.lto-pgo/build/Lib/tkinter/__init__.py", line 2405, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_tkinter.TclError: no display name and no $DISPLAY environment variable

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot PPC64LE RHEL8 LTO 3.x has failed when building commit adedcfa.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/361/builds/4332) and take a look at the build logs.
  4. Check if the failure is related to this commit (adedcfa) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/361/builds/4332

Failed tests:

  • test_idle

Failed subtests:

  • setUpClass - idlelib.idle_test.test_debugger.NameSpaceTest

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-ppc64le.lto/build/Lib/idlelib/idle_test/test_debugger.py", line 282, in setUpClass
    cls.root = Tk()
               ^^^^
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-ppc64le.lto/build/Lib/tkinter/__init__.py", line 2405, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_tkinter.TclError: no display name and no $DISPLAY environment variable

aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
Add docstrings to the debugger module. Fix two bugs: initialize Idb.botframe (should be in Bdb); In Idb.in_rpc_code, check whether prev_frame is None before trying to use it. Make other code changes.

Expand test_debugger coverage from 19% to 66%.
---------
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
Add docstrings to the debugger module. Fix two bugs: initialize Idb.botframe (should be in Bdb); In Idb.in_rpc_code, check whether prev_frame is None before trying to use it. Make other code changes.

Expand test_debugger coverage from 19% to 66%.
---------
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
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.

8 participants