Message266072
| Author |
xdegaye |
| Recipients |
Alex.Willmer, pitrou, rosslagerwall, serhiy.storchaka, twouters, xdegaye |
| Date |
2016年05月22日.12:22:40 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1463919760.45.0.799256464998.issue26927@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|