bpo-39393: Misleading error message on dependent DLL resolution failure (GH-18093)

https://github.com/python/cpython/commit/13c1c3556f2c12d0be2af890fabfbf44280... commit: 13c1c3556f2c12d0be2af890fabfbf44280b845c branch: master author: Zackery Spytz <zspytz@gmail.com> committer: Steve Dower <steve.dower@python.org> date: 2020-01-28T20:42:43+11:00 summary: bpo-39393: Misleading error message on dependent DLL resolution failure (GH-18093) files: A Misc/NEWS.d/next/Windows/2020-01-20-23-42-53.bpo-39393.gWlJDG.rst M Modules/_ctypes/callproc.c diff --git a/Misc/NEWS.d/next/Windows/2020-01-20-23-42-53.bpo-39393.gWlJDG.rst b/Misc/NEWS.d/next/Windows/2020-01-20-23-42-53.bpo-39393.gWlJDG.rst new file mode 100644 index 0000000000000..025b7e96a6e74 --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2020-01-20-23-42-53.bpo-39393.gWlJDG.rst @@ -0,0 +1,2 @@ +Improve the error message when attempting to load a DLL with unresolved +dependencies. diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c index 7b13fa041a205..65c6eb15a298b 100644 --- a/Modules/_ctypes/callproc.c +++ b/Modules/_ctypes/callproc.c @@ -1311,8 +1311,9 @@ static PyObject *load_library(PyObject *self, PyObject *args) if (err == ERROR_MOD_NOT_FOUND) { PyErr_Format(PyExc_FileNotFoundError, - ("Could not find module '%.500S'. Try using " - "the full path with constructor syntax."), + ("Could not find module '%.500S' (or one of its " + "dependencies). Try using the full path with " + "constructor syntax."), nameobj); return NULL; } else if (err) {
participants (1)
-
Steve Dower