[issue4957] os.ftruncate raises IOError instead of OSError
Kristján Valur Jónsson
report at bugs.python.org
Fri Jan 16 00:01:02 CET 2009
New submission from Kristján Valur Jónsson <kristjan at ccpgames.com>:
I stumbled upon this. Of all the errors in the posixmodule.c, ftruncate
alone raises an IOError upon failure. All the others raise OSError.
This behaviour is not documented. However, the os module documentation
says>
Note
All functions in this module raise OSError in the case of invalid or
inaccessible file names and paths, or other arguments that have the
correct type, but are not accepted by the operating system.
This came to light when I added tests to verify that exceptions were
being raised by invalid file descriptors.
I propose to fix this to comply with the docs.
----------
components: Interpreter Core
files: ftruncate.patch
keywords: patch, patch
messages: 79925
nosy: krisvale
severity: normal
status: open
title: os.ftruncate raises IOError instead of OSError
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file12759/ftruncate.patch
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4957>
_______________________________________
More information about the Python-bugs-list
mailing list