This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients eryksun, michaellongge, paul.moore, steve.dower, tim.golden, zach.ware
Date 2022-01-30.18:49:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1643568544.59.0.400881904431.issue46578@roundup.psfhosted.org>
In-reply-to
Content
> cmd310 = ["/LIBPATH:D:\\python310\\lib\\site-packages\\torch\\lib",

The `argv` parameter of os.spawnv() should begin with a command name to ensure that the application parses its command-line correctly. This doesn't necessarily have to be a file path since the `path` argument is what gets executed. For example, in this case I would use `cmd310 = ["link", ...]`.

That said, for various reasons, including the correct quoting of command-line arguments that contain spaces, I recommend that you use the subprocess module instead of os.spawnv(). For example, use `p = subprocess.run(cmd310, executable=executable)`. The first item of the argument list still needs to be "link" in this case. Or include the full path of "link.exe" at the start of cmd310, and use `p = subprocess.run(cmd310)`.

> But i cant DEBUG os.spawnv() on Pycharm.

In Windows, os.spawnv() is a builtin function from the nt extension module, defined in Modules/posixmodule.c. It is not defined in os.py. The C implementation is a minimal wrapper around the C runtime's _wspawnv() function [1]. Probably PyCharm isn't capable of debugging a builtin function.

---
[1] https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/spawnv-wspawnv
History
Date User Action Args
2022-01-30 18:49:04eryksunsetrecipients: + eryksun, paul.moore, tim.golden, zach.ware, steve.dower, michaellongge
2022-01-30 18:49:04eryksunsetmessageid: <1643568544.59.0.400881904431.issue46578@roundup.psfhosted.org>
2022-01-30 18:49:04eryksunlinkissue46578 messages
2022-01-30 18:49:04eryksuncreate