Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Debugger experiences FileNotFoundError internal error #668

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

Open
programmerPhysicist opened this issue Mar 15, 2025 · 5 comments
Open

Debugger experiences FileNotFoundError internal error #668

programmerPhysicist opened this issue Mar 15, 2025 · 5 comments
Assignees
Labels
info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team

Comments

@programmerPhysicist
Copy link

programmerPhysicist commented Mar 15, 2025

Type: Bug

Behavior

When I debug a test, instead of breaking at a known python error, it finishes the test and displays an internal error in the Debug Console:
Image

Expected behavior:

It should hit a breakpoint at Project_Hype-Berry/source/hab_task.py:197 due to a KeyError, as I've seen when I run pytest --pdb in a terminal:

self = <hab_task.HabTask object at 0x7fcc6b2dd5d0>

    @property
    def dueToday(self):
        """This is intended to tell us if a given daily is due today or not."""
        if self.__task_dict['type'] == 'daily':
>           return self.__task_dict['isDue']
E           KeyError: 'isDue'

/home/alex/Workspace/temp/Project_Hype-Berry/source/hab_task.py:197: KeyError
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> entering PDB >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> PDB post_mortem (IO-capturing turned off) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> /home/alex/Workspace/temp/Project_Hype-Berry/source/hab_task.py(197)dueToday()
-> return self.__task_dict['isDue']
(Pdb) 

Steps to reproduce:

Steps to reproduce:

  1. Clone this repo: https://github.com/programmerPhysicist/Project_Hype-Berry
  2. Checkout the branch vscode-bug: git checkout vscode-bug
  3. Open VS Code with code . in the repo
  4. Click on the "Testing" tab
  5. Right click on "dailies_test.py" and select "Debug Test"
  6. The following behavior

Image

should be observed

Diagnostic data

launch.json configuration

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug oneWaySync",
            "type": "debugpy",
            "request": "launch",
            "program": "one_way_sync.py",
            "console": "integratedTerminal",
            "justMyCode": false,
            "cwd": "${workspaceFolder}/source/",
            "env": {"http_proxy":"", "https_proxy": ""},
        }
    ]
}

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

2025-03-14 22:05:45.055 [info] arg: --rootdir already exists in args, not adding.
2025-03-14 22:05:45.055 [info] Attempting to use temp directory for test ids file, file name: test-ids-768384ddf0dd243c05a7.txt
2025-03-14 22:05:45.056 [info] All environment variables set for pytest execution, PYTHONPATH: "/home/alex/.vscode/extensions/ms-python.python-2025.2.0-linux-x64/python_files:source"
2025-03-14 22:05:45.056 [info] Running DEBUG pytest with arguments: --rootdir=/home/alex/Workspace/temp/Project_Hype-Berry,--capture=no for workspace /home/alex/Workspace/temp/Project_Hype-Berry 

2025-03-14 22:05:45.056 [info] Using configuration in launch.json
2025-03-14 22:05:49.563 [error] Test Results named pipe /run/user/1000/python-test-results-c76a773a885ca60ec194 error: [TypeError: Cannot convert undefined or null to object
	at Function.keys (<anonymous>)
	at t.PythonResultResolver._resolveExecution (/home/alex/.vscode/extensions/ms-python.python-2025.2.0-linux-x64/out/client/extension.js:2:917078)
	at t.PythonResultResolver.resolveExecution (/home/alex/.vscode/extensions/ms-python.python-2025.2.0-linux-x64/out/client/extension.js:2:916387)
	at /home/alex/.vscode/extensions/ms-python.python-2025.2.0-linux-x64/out/client/extension.js:2:960049
	at b.callback (/home/alex/.vscode/extensions/ms-python.python-2025.2.0-linux-x64/out/client/extension.js:2:930145)
	at Object.thunk (/home/alex/.vscode/extensions/ms-python.python-2025.2.0-linux-x64/out/client/extension.js:2:1994360)]
2025-03-14 22:05:50.207 [info] Test Result named pipe /run/user/1000/python-test-results-c76a773a885ca60ec194  cancelled

Output for Python Debugger in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python Debugger)

2025-03-14 22:05:45.166 [info] Resolving launch configuration with substituted variables
2025-03-14 22:05:45.187 [info] DAP Server launched with command: /usr/bin/python3 /home/alex/.vscode/extensions/ms-python.debugpy-2025.4.1-linux-x64/bundled/libs/debugpy/adapter
2025-03-14 22:05:45.435 [info] Received 'debugpySockets' event from debugpy.
2025-03-14 22:05:45.438 [info] Received 'debugpySockets' event from debugpy.
2025-03-14 22:05:45.439 [info] Received 'debugpySockets' event from debugpy.
2025-03-14 22:05:45.929 [info] Received 'debugpySockets' event from debugpy.
2025-03-14 22:05:50.199 [info] Received 'debugpySockets' event from debugpy.
2025-03-14 22:05:50.205 [info] Received 'debugpySockets' event from debugpy.

Extension version: 2025.4.1
VS Code version: Code 1.98.2 (ddc367ed5c8936efe395cffeec279b04ffd7db78, 2025-03-12T13:32:45.399Z)
OS version: Linux x64 5.15.0-134-generic
Modes:

  • Python version (& distribution if applicable, e.g. Anaconda): 3.10.12
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Unknown
System Info
Item Value
CPUs AMD Ryzen 3 3200U with Radeon Vega Mobile Gfx (4 x 2915)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
webnn: disabled_off
Load (avg) 1, 1, 1
Memory (System) 5.72GB (1.35GB free)
Process Argv .
Screen Reader no
VM 0%
DESKTOP_SESSION cinnamon
XDG_CURRENT_DESKTOP X-Cinnamon
XDG_SESSION_DESKTOP cinnamon
XDG_SESSION_TYPE x11
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Mar 15, 2025
@eleanorjboyd
Copy link
Member

thanks for the detailed bug report- I will investigate

@eleanorjboyd
Copy link
Member

able to repro- thanks for the steps. I am seeing pathlib.Path.cwd() set to cwd = PosixPath('/private/var/folders/q8/17wzg0cx7p59c1qfvwxx8yhc0000gn/T/pytest-of-eleanorboyd/pytest-12/config0') for me. Are you mocking it out somehow. I wasn't able to see in the code where that might be but it is being adjusted which would cause the problem there

@eleanorjboyd eleanorjboyd added the info-needed Issue requires more information from poster label Mar 31, 2025
@programmerPhysicist
Copy link
Author

programmerPhysicist commented Apr 5, 2025

In this case it isn't being mocked. The test is setup to change the cwd.

@programmerPhysicist
Copy link
Author

Even then, it should should return the cwd.

Copy link

github-actions bot commented May 5, 2025

Hey @eleanorjboyd, this issue might need further attention.

@programmerPhysicist, you can help us out by closing this issue if the problem no longer exists, or adding more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants