Skip to content
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

Fix problem with lineno being none when generating traceback #1750

Merged
merged 2 commits into from
Dec 2, 2024

Improve multiline statement handling in stack summary

5ef7e20
Select commit
Loading
Failed to load commit list.
Merged

Fix problem with lineno being none when generating traceback #1750

Improve multiline statement handling in stack summary
5ef7e20
Select commit
Loading
Failed to load commit list.
Azure Pipelines / debugpy-test failed Dec 2, 2024 in 42m 20s

Build #20241202.2 had test failures

Details

Tests

  • Failed: 2 (0.01%)
  • Passed: 16,163 (82.33%)
  • Other: 3,466 (17.66%)
  • Total: 19,631

Annotations

Check failure on line 1109 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / debugpy-test

Build log #L1109

PowerShell exited with code '1'.

Check failure on line 1 in test_set_expression[program-launch]

See this annotation in the file changed.

@azure-pipelines azure-pipelines / debugpy-test

test_set_expression[program-launch]

failed on setup with "worker 'gw5' crashed while running 'tests/debugpy/test_evaluate.py::test_set_expression[program-launch]'"
Raw output
worker 'gw5' crashed while running 'tests/debugpy/test_evaluate.py::test_set_expression[program-launch]'

Check failure on line 1 in test_shell_expansion[expand-launch(console=integratedTerminal)-code]

See this annotation in the file changed.

@azure-pipelines azure-pipelines / debugpy-test

test_shell_expansion[expand-launch(console=integratedTerminal)-code]

debugpy.common.messaging.NoMoreMessages: No more messages
Raw output
pyfile = <function pyfile.<locals>.factory at 0x0000024B44B94A40>
target = <class 'tests.debug.targets.Code'>
run = launch(console=integratedTerminal), expansion = 'expand'

    @pytest.mark.parametrize("target", targets.all)
    @pytest.mark.parametrize("run", runners.all_launch)
    @pytest.mark.parametrize("expansion", ["preserve", "expand"])
    def test_shell_expansion(pyfile, target, run, expansion):
        if expansion == "expand" and run.console == "internalConsole":
            pytest.skip('Shell expansion is not supported for "internalConsole"')
    
        @pyfile
        def code_to_debug():
            import sys
            import debuggee
            from debuggee import backchannel
    
            debuggee.setup()
            backchannel.send(sys.argv)
    
        def expand(args):
            if expansion != "expand":
                return
            log.info("Before expansion: {0}", args)
            for i, arg in enumerate(args):
                if arg.startswith("$"):
                    args[i] = arg[1:]
            log.info("After expansion: {0}", args)
    
        class Session(debug.Session):
            def run_in_terminal(self, args, cwd, env):
                expand(args)
                return super().run_in_terminal(args, cwd, env)
    
        argslist = ["0", "$1", "2"]
        args = argslist if expansion == "preserve" else " ".join(argslist)
        with Session() as session:
            backchannel = session.open_backchannel()
>           with run(session, target(code_to_debug, args=args)):

tests\debugpy\test_args.py:69: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests\debug\runners.py:82: in __call__
    return f(session, target, *self._args, **self._kwargs)
tests\debug\runners.py:148: in launch
    return session.request_launch()
tests\debug\session.py:713: in request_launch
    return self._request_start("launch")
tests\debug\session.py:672: in _request_start
    start_request.response.result  # raise exception if failed
tests\timeline.py:1115: in result
    return self.message.result
.tox\py312\Lib\site-packages\debugpy\common\messaging.py:909: in result
    raise self.body
.tox\py312\Lib\site-packages\debugpy\common\messaging.py:1296: in _parse_incoming_messages
    self._parse_incoming_message()
.tox\py312\Lib\site-packages\debugpy\common\messaging.py:1364: in _parse_incoming_message
    message_dict = self.stream.read_json(decoder)
.tox\py312\Lib\site-packages\debugpy\common\messaging.py:208: in read_json
    line = read_line()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = JsonIOStream('Adapter[1]'), reader = <_io.FileIO [closed]>

    def _read_line(self, reader):
        line = b""
        while True:
            try:
                line += reader.readline()
            except Exception as exc:
                raise NoMoreMessages(str(exc), stream=self)
            if not line:
>               raise NoMoreMessages(stream=self)
E               debugpy.common.messaging.NoMoreMessages: No more messages

.tox\py312\Lib\site-packages\debugpy\common\messaging.py:172: NoMoreMessages