Message266072
On linux with large file support, OSError is raised when the file system limit is exceeded, here with ext4:
>>> f.seek(2**44 - 2**11)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 22] Invalid argument
>>> f.seek(2**44 - 2**12)
17592186040320
>>> f.write(b'A' * 2**11)
2048
>>> f.write(b'A' * 2**11)
2048
>>> f.tell()
17592186044416
>>> f.write(b'A' * 2**11)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 27] File too large
On the Android emulator (no large file support):
>>> f.seek(2**31)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: cannot fit 'int' into an offset-sized integer
>>> f.seek(2**31 - 1)
2147483647
>>> f.write(b'A')
1
>>> f.tell()
-2147483648
>>> f.flush()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 75] Value too large for defined data type
Surprisingly f.write(b'A') does not raise an exception. |
|
Date |
User |
Action |
Args |
2016-05-22 12:22:40 | xdegaye | set | recipients:
+ xdegaye, twouters, pitrou, rosslagerwall, serhiy.storchaka, Alex.Willmer |
2016-05-22 12:22:40 | xdegaye | set | messageid: <1463919760.45.0.799256464998.issue26927@psf.upfronthosting.co.za> |
2016-05-22 12:22:40 | xdegaye | link | issue26927 messages |
2016-05-22 12:22:40 | xdegaye | create | |
|