Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pythongh-120754: Update estimated_size in C truncate (python#121357)
Sometimes a large file is truncated (test_largefile). While estimated_size is used as a estimate (the read will stil get the number of bytes in the file), that it is much larger than the actual size of data can result in a significant over allocation and sometimes lead to a MemoryError / running out of memory. This brings the C implementation to match the Python _pyio implementation.
- Loading branch information