Issue #12442: nt._getdiskusage() is now using the Windows Unicode API

This commit is contained in:
Victor Stinner 2011-11-09 22:14:14 +01:00
parent fd9cd24a05
commit 6139c1bfa3

View file

@ -8163,13 +8163,13 @@ win32__getdiskusage(PyObject *self, PyObject *args)
{ {
BOOL retval; BOOL retval;
ULARGE_INTEGER _, total, free; ULARGE_INTEGER _, total, free;
LPCTSTR path; const wchar_t *path;
if (! PyArg_ParseTuple(args, "s", &path)) if (! PyArg_ParseTuple(args, "u", &path))
return NULL; return NULL;
Py_BEGIN_ALLOW_THREADS Py_BEGIN_ALLOW_THREADS
retval = GetDiskFreeSpaceEx(path, &_, &total, &free); retval = GetDiskFreeSpaceExW(path, &_, &total, &free);
Py_END_ALLOW_THREADS Py_END_ALLOW_THREADS
if (retval == 0) if (retval == 0)
return PyErr_SetFromWindowsErr(0); return PyErr_SetFromWindowsErr(0);