[issue25608] ascynio readexactly() should raise ValueError if passed length <= 0 in argument

2015-12-17 Thread Yury Selivanov
Yury Selivanov added the comment: This issue is now resolved (see https://github.com/python/asyncio/pull/298) -- resolution: -> fixed status: open -> closed ___ Python tracker

[issue25608] ascynio readexactly() should raise ValueError if passed length <= 0 in argument

2015-11-29 Thread Марк Коренберг
Марк Коренберг added the comment: Okay, https://github.com/python/asyncio/pull/298 is ready -- ___ Python tracker ___

[issue25608] ascynio readexactly() should raise ValueError if passed length <= 0 in argument

2015-11-27 Thread Guido van Rossum
Guido van Rossum added the comment: read(0) on a regular stream and os.read(fd, 0) also return an empty string without error. This is not something we should keep debating. -- ___ Python tracker

[issue25608] ascynio readexactly() should raise ValueError if passed length <= 0 in argument

2015-11-27 Thread Марк Коренберг
Марк Коренберг added the comment: result of readexactly(0) is indistinguishable from EOF, so no one should try to use that as I think. What is the useful case when zero bytes should be read ? -- ___ Python tracker

[issue25608] ascynio readexactly() should raise ValueError if passed length <= 0 in argument

2015-11-12 Thread Guido van Rossum
Guido van Rossum added the comment: I'm okay with raising ValueError for length<0; but for length==0 the behavior is very much intentional -- reading zero bytes is sometimes a useful end case that otherwise you would have to work around in the caller. --

[issue25608] ascynio readexactly() should raise ValueError if passed length <= 0 in argument

2015-11-12 Thread Марк Коренберг
New submission from Марк Коренберг: ascynio readexactly() should raise ValueError if passed length <= 0 in argument. Now, it return empty string, which is just error hiding. Why not to raise ValueError ? Returning empty string is error prone. This behaviour was not changed since initial