Socket module bug on OpenVMS

Irmen de Jong irmen.NOSPAM at xs4all.nl
Tue Oct 24 01:30:17 CEST 2006


Martin v. Löwis wrote:
> Irmen de Jong schrieb:
>> In my opinion Python's socket module itself could implement these
>> workarounds. That would make user code a lot cleaner and less
>> error prone, and more portable. What do other people think?
> 
> It depends: when VMS defines MSG_WAITALL, but doesn't implement it
> correctly, then Python probably shouldn't expose it.

That would be one way of solving at least my troubles, because I
already check for the availability of MSG_WAITALL and revert to
a custom recv() loop otherwise.
As others have already reported, at this time Python (well, the build
process) merely checks for the availability of the MSG_WAITALL symbol
in the socket.h C-header file....

> Implementing recv() "splitting" is *not* something that Python
> could do itself. The question is how you do error reporting
> for partial results
[..snip..]

Mm, tricky. Hadn't thought of that.

Although I'm not yet convinced about the all-or-nothing failure
model you were talking about. How can I know if recv() fails
with a MemoryError (or socket error) that it actually didn't
receive anything? Is that even an assumption I can rely on?
If it isn't, splitting up the recv() internally (into smaller
blocks) wouldn't be any different, right?

> Perhaps you had some different work-around in mind?

Nope, I was indeed thinking about splitting up the recv() into
smaller blocks internally.
Maybe a more elaborate check in Python's build system (to remove
the MSG_WAITALL on VMS) would qualify as some sort of work-around
as well. Although that would not yet solve the errors you get when
using too big recv() buffer sizes.


Cheers,
--Irmen.



More information about the Python-list mailing list