[issue8493] socket's send can raise errno 35 under OS X, which causes problems in sendall

2010-04-27 Thread Matthew Cowles
Matthew Cowles mdcow...@users.sourceforge.net added the comment: Apologies! Further investigation indicates that the user had set a timeout in the ftplib module. I'll close this. In an ideal world, errors due to timeouts would look like they were related to timeouts. But that's a different

[issue8493] socket's send can raise errno 35 under OS X, which causes problems in sendall

2010-04-26 Thread Charles-Francois Natali
Charles-Francois Natali neolo...@free.fr added the comment: That's what I thought at first too. But the user's sockets were set to blocking. That's one broken networking stack... In fact, I think it's a little silly that OS X raises the error rather than just saying that 0 bytes were

[issue8493] socket's send can raise errno 35 under OS X, which causes problems in sendall

2010-04-26 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: That's what I thought at first too. But the user's sockets were set to blocking. If you set a timeout on a socket, it is really non-blocking internally (from the OS' point of view). So perhaps this is what you are witnessing. By the way,

[issue8493] socket's send can raise errno 35 under OS X, which causes problems in sendall

2010-04-26 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: What is the mnemonic corresponding to errno 35 under OS X? (under Linux I get EDEADLOCK, which probably isn't the right one) -- ___ Python tracker rep...@bugs.python.org

[issue8493] socket's send can raise errno 35 under OS X, which causes problems in sendall

2010-04-26 Thread Jean-Paul Calderone
Jean-Paul Calderone exar...@twistedmatrix.com added the comment: What is the mnemonic corresponding to errno 35 under OS X? EAGAIN -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8493 ___

[issue8493] socket's send can raise errno 35 under OS X, which causes problems in sendall

2010-04-26 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Matthew, can you confirm whether the socket had a timeout set to it? (either through settimeout() or setglobaltimeout()) I think this is a bug in Python's socket module. recv()-like functions are written so as to first call select() before

[issue8493] socket's send can raise errno 35 under OS X, which causes problems in sendall

2010-04-26 Thread Charles-Francois Natali
Charles-Francois Natali neolo...@free.fr added the comment: What is the mnemonic corresponding to errno 35 under OS X? (under Linux I get EDEADLOCK, which probably isn't the right one) From the first message: errno 35 (resource temporarily unavailable). It's actually EAGAIN on Linux (which

[issue8493] socket's send can raise errno 35 under OS X, which causes problems in sendall

2010-04-26 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: [...] we call internal_select(s, 1) (1 for writting) before sending. Oh, sorry, you are right. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8493

[issue8493] socket's send can raise errno 35 under OS X, which causes problems in sendall

2010-04-26 Thread Jean-Paul Calderone
Jean-Paul Calderone exar...@twistedmatrix.com added the comment: But as I said, it's not reliable. I don't see any evidence in support of this statement. Did you notice that the FreeBSD thread you referenced is: * 6 years old * about UDP It's not obvious to me that it's actually

[issue8493] socket's send can raise errno 35 under OS X, which causes problems in sendall

2010-04-26 Thread Charles-Francois Natali
Charles-Francois Natali neolo...@free.fr added the comment: I don't see any evidence in support of this statement. From Microfost Windows' documentation: The parameter writefds identifies the sockets that are to be checked for writability. If a socket is processing a connect call

[issue8493] socket's send can raise errno 35 under OS X, which causes problems in sendall

2010-04-26 Thread Matthew Cowles
Matthew Cowles mdcow...@users.sourceforge.net added the comment: [Replying to various posts] [neologix] That's one broken networking stack... I'm not disagreeing, but you'd have to take that up with Apple. How would you circumvent this problem anyway ? The code has to go around again in

[issue8493] socket's send can raise errno 35 under OS X, which causes problems in sendall

2010-04-26 Thread Jean-Paul Calderone
Jean-Paul Calderone exar...@twistedmatrix.com added the comment: None of that has much relevance when the socket is in *non-blocking* mode. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8493

[issue8493] socket's send can raise errno 35 under OS X, which causes problems in sendall

2010-04-26 Thread Jean-Paul Calderone
Jean-Paul Calderone exar...@twistedmatrix.com added the comment: If there's something else that would be useful and I can provide it, I'd be glad to. A minimal example which reproduces the behavior. :) -- ___ Python tracker rep...@bugs.python.org

[issue8493] socket's send can raise errno 35 under OS X, which causes problems in sendall

2010-04-26 Thread Matthew Cowles
Matthew Cowles mdcow...@users.sourceforge.net added the comment: A minimal example which reproduces the behavior. :) Unfortunately the problem wasn't mine originally. I'm just the guy on python-help who happened to figure out the answer. But if someone can get me access to an FTP server on

[issue8493] socket's send can raise errno 35 under OS X, which causes problems in sendall

2010-04-26 Thread Jean-Paul Calderone
Jean-Paul Calderone exar...@twistedmatrix.com added the comment: But if someone can get me access to an FTP server on the other end of a slow link, I'd be glad to do what I can half-wink. It's easy to get a slow FTP server. Twisted's FTP support lets you do all kinds of customization;

[issue8493] socket's send can raise errno 35 under OS X, which causes problems in sendall

2010-04-23 Thread Matthew Cowles
Matthew Cowles mdcow...@users.sourceforge.net added the comment: if you get this type of error, it's probably because you're using non- blocking sockets That's what I thought at first too. But the user's sockets were set to blocking. spinning around the send call trying to resend the data

[issue8493] socket's send can raise errno 35 under OS X, which causes problems in sendall

2010-04-22 Thread Charles-Francois Natali
Charles-Francois Natali neolo...@free.fr added the comment: The problem is that if you run out of network buffers (I guess it's equivalent to Unix socket buffers), what do you do ? If the network or the receiving host is congested, spinning around the send call trying to resend the data isn't

[issue8493] socket's send can raise errno 35 under OS X, which causes problems in sendall

2010-04-21 Thread Matthew Cowles
New submission from Matthew Cowles mdcow...@users.sourceforge.net: [From a question first posted to python-help] A socket's send function may return 0 if no bytes have been sent. Under at least OS X 10.6.2, it may also raise errno 35 (resource temporarily unavailable) if no network buffers