New submission from Kristján Valur Jónsson <krist...@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 <rep...@bugs.python.org>
<http://bugs.python.org/issue4957>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to