diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2019-02-19 18:46:32 -0800 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2019-02-19 18:46:32 -0800 |
commit | 76ab63bd63092c432c4cb2397a1cc45602e7e5a7 (patch) | |
tree | 98674f2ae49a1bca5e635eafd2b460af422033f2 | |
parent | b0ad9b6484c9d0b1907b2141664f631f481af73e (diff) | |
download | psutil-76ab63bd63092c432c4cb2397a1cc45602e7e5a7.tar.gz |
fix #1420: use PyErr_SetFromWindowsErrWithFilename for disk_usage() in case of error
-rw-r--r-- | HISTORY.rst | 5 | ||||
-rw-r--r-- | psutil/_psutil_windows.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/HISTORY.rst b/HISTORY.rst index be3787e7..b4f4888d 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -13,6 +13,11 @@ XXXX-XX-XX - 1419_: [Windows] Process.environ() raises NotImplementedError when querying a 64-bit process in 32-bit-WoW mode. Now it raises AccessDenied. +**Enhancements** + +- 1420_: [Windows] in case of exception disk_usage() now also shows the path + name. + 5.5.1 ===== diff --git a/psutil/_psutil_windows.c b/psutil/_psutil_windows.c index 55a1cb22..d6058b8b 100644 --- a/psutil/_psutil_windows.c +++ b/psutil/_psutil_windows.c @@ -2338,7 +2338,7 @@ psutil_disk_usage(PyObject *self, PyObject *args) { return_: if (retval == 0) - return PyErr_SetFromWindowsErr(0); + return PyErr_SetFromWindowsErrWithFilename(0, path); else return Py_BuildValue("(LL)", total.QuadPart, free.QuadPart); } |