From f2f373f5931be48efc3f6fa2c2faa1cca79dce75 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Sat, 21 Feb 2015 08:44:05 -0800 Subject: Issue #23152: Implement _Py_fstat() to support files larger than 2 GB on Windows. fstat() may fail with EOVERFLOW on files larger than 2 GB because the file size type is an signed 32-bit integer. --- Python/sysmodule.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Python/sysmodule.c') diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 0639231282c..292830bc25f 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -1681,8 +1681,8 @@ _PySys_Init(void) the shell already prevents that. */ #if !defined(MS_WINDOWS) { - struct stat sb; - if (fstat(fileno(stdin), &sb) == 0 && + struct _Py_stat_struct sb; + if (_Py_fstat(fileno(stdin), &sb) == 0 && S_ISDIR(sb.st_mode)) { /* There's nothing more we can do. */ /* Py_FatalError() will core dump, so just exit. */ -- cgit v1.2.3