The Linux kernel obviously has a lot of file support since ls -l working correctly. So this is your Python installation that lacks support. (Do you use your Python distribution? What is this distribution?)
The documentation for POSIX large file support in Python states that Python should usually use more file support if it is available on Linux. He also suggests trying and configuring Python with the command line.
CFLAGS='-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64' OPT="-g -O2 $CFLAGS" \ ./configure
And finally, on the stat system call page:
This can happen if an application compiled on a 32-bit platform without -D_FILE_OFFSET_BITS=64 calls stat() in a file that is larger than a bit (1<<31)-1 .
(I believe the last word should be "bytes.")
Sven marnach
source share