fabioz / PyDev.Debugger

Sources for the debugger used in PyDev, PyCharm and VSCode Python
Eclipse Public License 1.0
432 stars 122 forks source link

bugfix: Support PathLike objects for subprocess #217

Closed Eyal-Shalev closed 2 years ago

Eyal-Shalev commented 2 years ago

This fixes https://youtrack.jetbrains.com/issue/PY-48506/error-on-pydevmonkey-in-debug-mode-AttributeError-PosixPath-object-has-no-attribute-endswith by checking if the path is PathLike, and calling fspath() to get the string version of the path.

fabioz commented 2 years ago

Thanks for the patch... Seems good to me, but this will probably need a test along.

I can do it, but I need to finish up something first...

Eyal-Shalev commented 2 years ago

@fabioz can you approve the workflow so that the current tests could run?

fabioz commented 2 years ago

While checking for a test I saw that there is already code which deals with handling Path in pydev_monkey (so, I don't think this patch is needed).

This was probably an issue just in the PyCharm version of pydevd (they currently have a fork which isn't exactly the same code) and is fixed differently in plain pydevd.