Issue #9566: Fix compiler warning on Windows 64-bit
diff --git a/Python/fileutils.c b/Python/fileutils.c
index bb0cd43..293cb77 100644
--- a/Python/fileutils.c
+++ b/Python/fileutils.c
@@ -707,7 +707,8 @@
 _Py_wgetcwd(wchar_t *buf, size_t size)
 {
 #ifdef MS_WINDOWS
-    return _wgetcwd(buf, size);
+    int isize = (int)Py_MIN(size, INT_MAX);
+    return _wgetcwd(buf, isize);
 #else
     char fname[PATH_MAX];
     wchar_t *wname;