This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_mmap should catch f.close() failure in LargeMmapTests._make_test_file()
Type: Stage: resolved
Components: Tests Versions: Python 3.6, Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: berker.peksag, jbeck, martin.panter, python-dev
Priority: normal Keywords: patch

Created on 2015-09-04 22:06 by jbeck, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
26-test_mmap.patch jbeck, 2015-09-04 22:06 patch to fix test_mmap
Messages (4)
msg249840 - (view) Author: John Beck (jbeck) Date: 2015-09-04 22:06
When running test_mmap on a partition with < 4GB free, it back-traced:

Traceback (most recent call last):
  File "/usr/lib/python3.4/test/test_mmap.py", line 728, in _make_test_file
    f.flush()
OSError: [Errno 28] No space left on device

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.4/test/test_mmap.py", line 735, in test_large_offset
    with self._make_test_file(0x14FFFFFFF, b" ") as f:
  File "/usr/lib/python3.4/test/test_mmap.py", line 730, in _make_test_file
    f.close()
OSError: [Errno 28] No space left on device

but by wrapping the f.close() inside another try/except block, its failure was caught and the test was able to complete, resulting in a skip for this sub-test and an OK for the overall test.
msg250038 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-09-07 02:49
Patch looks good to me. Anything that fails flush() is likely to also fail close(). But I cannot reproduce the actual failure. Perhaps it requires a file system like FAT that doesn’t support “holes” in files.
msg250051 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-09-07 04:17
New changeset 7a9dddc11f2e by Martin Panter <vadmium> in branch '3.4':
Issue #25004: Handle out-of-disk-space error in LargeMmapTests
https://hg.python.org/cpython/rev/7a9dddc11f2e

New changeset fd4bf05b32ba by Martin Panter <vadmium> in branch '3.5':
Issue #25004: Merge 3.4 into 3.5
https://hg.python.org/cpython/rev/fd4bf05b32ba

New changeset 6c9159661aa8 by Martin Panter <vadmium> in branch 'default':
Issue #25004: Merge 3.5 into 3.6
https://hg.python.org/cpython/rev/6c9159661aa8
msg250056 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-09-07 04:27
Okay I was able to force the error by using all my disk space up, and confirmed the change works.
History
Date User Action Args
2022-04-11 14:58:20adminsetgithub: 69192
2015-09-07 04:27:40martin.pantersetstatus: open -> closed
resolution: fixed
messages: + msg250056

stage: commit review -> resolved
2015-09-07 04:18:00python-devsetnosy: + python-dev
messages: + msg250051
2015-09-07 02:49:18martin.pantersetnosy: + berker.peksag, martin.panter

messages: + msg250038
stage: commit review
2015-09-04 22:06:21jbeckcreate