Commit graph

90 commits

Author SHA1 Message Date
Rich Chiodo
698499e9ec
Add support for space in the python file (#1982)
Some checks failed
Code scanning - action / CodeQL-Build (push) Has been cancelled
* Add support for space in the python file itself when using shell expansion.

* Fix linter

* Fix flakey test
2025-12-12 16:04:10 -08:00
Rich Chiodo
e5017d7360
Fix arq quoting to work in runInTerminal (#1981)
Some checks failed
Code scanning - action / CodeQL-Build (push) Has been cancelled
* Fix arq quoting to work in runInTerminal

* Default was backwards

* Fix ruff errors

* Fix failing tests

* Only strip quotes on the exe

* Try fixing gw worker failures

* Skip certain test because of cmd limitations

* Need to skip all 'code' based tests on windows
2025-12-10 10:39:27 -08:00
rabbit
34d5de99a0
IPv6 support (#1896)
* Add initial support for IPv6

* address comments (part 1)

* quick clean up of missed fix suggestion

* Fix misassigned default serving server address in adapter client

* add wrapper method to get host and port from`getsockname`
2025-05-22 13:04:11 -07:00
Rich Chiodo
02723de140
Fix multithreading stepping in 3.12 and later (#1798)
* Fix multithreaded stepping to not have 'return' events when a thread is already suspended

* Update after removing blank line

* Remove unnecessary change for start method
2025-01-07 11:25:54 -08:00
Rich Chiodo
8ab4ee89e9
Try to get more logging from 3.13 failures (#1711)
* Add more logging for 313 failure

* Auto retry failures

* Add retry for socket.write

* Put watchdog timeout back and drop errors

* Fix linter

* Add message on error so at least it's logged

* Try a different combination

* Fix linter

* Go back to longer watchdog

* Try a different tactic

* Don't log failure and wait a bit in the watchdog

* Go back to the NoMoreMessages

* Just disable watchdog in 3.13 for now

* Change watchdog timeout

* Try different algorithm for ports in use

* Add retries option

* Fix usages of get_test_server_port

* Retries don't seem to work at global level with xdist, use retries on individual tests
2024-10-24 11:08:42 -07:00
Rich Chiodo
4d86a42380
Updates from pydevd (#1706)
* Changes from pushing to pydevd

* Update some time outs to get flakey tests to pass

* Fix string failure

* String case backwards. Fixup test in pydevd

* Using callstack for exception check not sufficient

* Too restrictive on pydevd matching

* Try somethign better than just checking 'pydev'

* Retry a flakey test

* Disable flakey tests

* Another flakey test

* Increase timeout for attach

* Try upping timeout

* Up watchdog timeout

* Up some more timeouts

* Try delaying shutdown of test apps

* Don't output extra things that tests don't expect

* Fix output differences in 3.9? Not sure what that's about

* Fixup line differences in 3.9 with extra sleep

* Fix linter errors

* Fix breakpoint bugs
2024-10-21 10:17:39 -07:00
Pavel Minaev
ef9a67fe15 Fix #1337: Get port info from debugpy
Send "debugpySockets" event with information about opened sockets when clients connect and whenever ports get opened or closed.
2023-10-06 09:55:52 -07:00
Pavel Minaev
88bf2c7827 Fix -Xfrozen_modules use in tests. 2023-08-28 13:14:39 -07:00
Pavel Minaev
83baa6d302 Fix -Xfrozen_modules warnings in test runs on Python 3.11 and 3.12 2023-08-17 11:00:07 -07:00
Pavel Minaev
e9dc3e8844 Fix #1074: Use "startDebugging" request for subprocesses
Use the request if client advertises the "supportsStartDebuggingRequest" capability.
2023-02-07 13:04:58 -08:00
Pavel Minaev
4f6638b0a6 Fix #1001: Enable controlling shell expansion via "argsCanBeInterpretedByShell"
Fix #357: "argsExpansion" does not do what it says in VSCode

Treat non-array "args" in debug config as a request to prevent shell argument escaping and allow shell expansion.

Remove "argsExpansion".
2022-08-04 13:49:32 -07:00
Pavel Minaev
0a9b01b008 Fix #865: Debugging through poetry drops subprocess
Handle "exited" { "pydevdReason": "processReplaced" } appropriately.

Add test for os.exec() in-place process replacement.
2022-06-09 10:44:10 -07:00
Pavel Minaev
d1e5db7d8e Use new-style super() everywhere. 2022-04-13 11:38:41 -07:00
Pavel Minaev
dd5196fbfc Blacken code. 2022-04-13 11:38:41 -07:00
Pavel Minaev
0f428178b0 Remove debugpy.compat, custom !j formatter for JSON, and related helpers. 2022-04-13 11:38:41 -07:00
Pavel Minaev
1965b47034 Get rid of fmt() and use idiomatic format() and f"" instead. 2022-04-13 11:38:41 -07:00
Pavel Minaev
98087352cb Remove code paths for unsupported Python versions. 2022-04-13 11:38:41 -07:00
Pavel Minaev
e87017e0b3 Remove redundant "from __future__ import ..." 2022-04-13 11:38:41 -07:00
Fabio Zadrozny
0105bd92ce Mark warning messages as important. Fixes #170 2022-01-20 15:32:19 -03:00
Michał Górny
eef3b4ef2b Fix deprecated import for MutableMapping and MutableSet
Starting with Python 3.3, MutableMapping and MutableSet are part
of collections.abc module rather than collections.  Importing them
from the old module is deprecated and no longer works in Python 3.10.
Support both modules conditionally for best compatibility.
2021-07-02 12:31:59 +02:00
Fabio Zadrozny
6403f1e369 Make sure _get_path_with_real_case is called with an absolute path. Fixes #620 2021-05-28 13:26:21 -03:00
Fabio Zadrozny
9ab891b328 Code reloading. Fixes #212 2021-03-11 10:26:51 -03:00
Fabio Zadrozny
f9b54cdcd9 Support running non-ascii files on Python 2. Fixes #206 2020-12-10 08:52:28 -03:00
Pavel Minaev
7d2a7a2b11 Fix #463: Enable overriding "pythonPath" in the launcher
Add "debugLauncherPython" debug config property to customize Python interpreter used to spawn the launcher.
2020-11-11 11:13:09 -08:00
Pavel Minaev
d68a17170c Re-enable attach by socket on macOS + Python 3.6 (per #1967). 2020-09-25 13:41:24 -07:00
Pavel Minaev
6e1c7567d2 Fix #81: Subprocess always waits for client to attach
Unblock subprocesses for which no notification could be sent to the client.
2020-09-25 13:41:24 -07:00
Pavel Minaev
14ca4f07d1 Fix #351: Python warnings in debugger code
Don't use inspect.getargspec on Python 2.

Close log file objects on exit.

Close os.devnull file objects on exit.

Close the listener socket used to get endpoints info from adapter.

Fix invalid escape sequences.

Run tests with Python warnings treated as errors.

Fix Django deprecation warning in test web app.

Work around pytest issues caused spaces in test names.
2020-09-03 01:32:58 -07:00
Pavel Minaev
2c524faacd Fix #305: Add "pythonArgs" config property for interpreter arguments
Expose "pythonArgs" to clients.

Make "python" usable in tests in lieu of "pythonPath", and make the runners use it.

Add tests for all combinations of "python"/"pythonPath" and "pythonArgs".
2020-08-03 11:45:55 -07:00
Pavel Minaev
73665b9af9 Parse and apply "python" / "pythonPath" in the adapter rather than in the launcher.
Fix errors with missing "args".

Add test for "pythonPath".
2020-05-08 17:10:34 -07:00
Pavel Minaev
1a44e70206 Fix #156: Add a flag for the old way of handling args from a launch config
Add new property "argsExpansion", which defaults to "shell", but can be explicitly set to "none" to request no expansion.

Propagate "args" to launcher via CLI or JSON, depending on the value of "argsExpansion".

Move the logic to compute process name back to the adapter, alongside other processing of "launch" targets.
2020-05-07 12:31:40 -07:00
Pavel Minaev
50bf46cf9d Add test for "args" shell expansion. 2020-04-22 13:55:01 -07:00
Fabio Zadrozny
011810aa42 Change __len__ to len(). 2020-04-21 08:20:54 -03:00
Fabio Zadrozny
d2014babd6 Show globals, group variables and show all dir() variables.
Fixes https://github.com/microsoft/ptvsd/issues/118
Fixes https://github.com/microsoft/ptvsd/issues/763
Fixes https://github.com/microsoft/ptvsd/issues/1621
2020-04-21 08:20:54 -03:00
Pavel Minaev
47dd3da5e7 Fix #99: multiprocessing triggers preLaunchTask and postDebugTask more than once
Remove "preLaunchTask" and "postDebugTask" from derived debug configurations generated for subprocesses.
2020-04-03 15:46:09 -07:00
Pavel Minaev
32c00bc85c Fix #92: Debugging as sudo fails to terminate the debugger when you stop
Apply sudo to debugpy.launcher, rather than the debuggee itself.
2020-04-01 21:16:20 -07:00
Pavel Minaev
2d35573eda Fix #90: "subProcess" is not respected
Propagate "subProcess" to the debug server via command line in launch scenarios.

Fix debugpy.configure() being a no-op rather than a shim for api.configure().
2020-04-01 20:10:34 -07:00
Pavel Minaev
dccb5e6198 Use "connect":{...} and "listen":{...} to indicate direction of connection in debug configuration. 2020-03-05 13:56:22 -08:00
Pavel Minaev
2d013e58ec Swap attach_listen / attach_connect to reflect the client perspective. 2020-03-05 13:56:22 -08:00
Pavel Minaev
6ad1382a8c Fix https://github.com/microsoft/ptvsd/issues/1824:
Allow ptvsd to run as server and let code connect to it

Expose --connect and debugpy.connect() as a public API, and add tests for it.
2020-03-05 13:56:22 -08:00
Pavel Minaev
4f43e00a07 Remove suppport for arrays in "program" and "module" debug configuration properties as alternative to "args".
Change the meaning of array for "code" debug configuration property to represent multiple lines of code.

Switch tests to use "args".
2020-02-21 15:55:17 -08:00
Pavel Minaev
de9ea2cb9c Improve exception logging to make swallowing/reraising explicit in all cases. 2020-02-21 15:55:04 -08:00
Pavel Minaev
8c114ed589 Purge all mentions of "IDE", and replace with "client" or "clients" as appropriate.
Blacken code.
2020-02-11 17:03:45 -08:00
Pavel Minaev
8447a15396 Refactor debugpy API and CLI for clarity and consistency. 2020-02-11 14:40:25 -08:00
Fabio Zadrozny
5d5f8f42ec Re-attach to pid when using --client. Fixes https://github.com/microsoft/ptvsd/issues/1817 2020-02-06 08:31:28 -03:00
Pavel Minaev
367ff72788 Send both "ptvsd" and "debugpy" telemetry events for smooth transition. 2020-01-29 14:32:28 -08:00
Pavel Minaev
55eac82c96 Fix #1811: tests using attach_by_pid fail on Python 2.7
Don't call enable_attach() and wait_for_attach() while under import lock.
2020-01-26 17:14:30 -08:00
Pavel Minaev
784f7bc271
Merge pull request #1 from int19h/1776
Fix https://github.com/microsoft/ptvsd/issues/1776
2020-01-21 22:24:39 -08:00
Pavel Minaev
00b6a202f3 Fix test_autokill 2020-01-21 17:27:28 -08:00
Pavel Minaev
522c3743f0 Another workaround for https://bugs.python.org/issue37380 2020-01-21 16:33:44 -08:00
Pavel Minaev
9bb539a2fc Work around https://bugs.python.org/issue37380 in tests. 2020-01-21 15:39:17 -08:00