[Patches] [ python-Patches-1771364 ] Misc improvements for the io module

SourceForge.net noreply at sourceforge.net
Fri Aug 10 04:11:37 CEST 2007


Patches item #1771364, was opened at 2007-08-10 03:43
Message generated for change (Settings changed) made by tiran
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1771364&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
Group: Python 3000
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Christian Heimes (tiran)
>Assigned to: Guido van Rossum (gvanrossum)
Summary: Misc improvements for the io module

Initial Comment:
My patch fixes small parts of the io module:

* replaced all asserts with appropriate TypeError() or ValueError() exceptions

* default to buffering = 1 when raw is a tty

* added four methods _checkSeekable(msg=None), _checkReadable, _checkWritable and _checkClosed as convenient methods to raise exceptions when a file is closed or not read, write or seekable.

* added a unit test to check __all__

* SocketIO.readable/writeable checks for self.closed, too

* SocketIO.readinto/write checks for readable, writeable and closed status

__all__ references SocketIO but it is not available in io.py. The definition is in socket.py and it doesn't use any socket related code directly. What do you think about moving SocketIO to io.py in the sake of keeping everything together?

NOTE: You may want to check my English in the exception messages. ;)

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1771364&group_id=5470


More information about the Patches mailing list