New Ticket     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #18376 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

Remedy socket 35 errors on all Python builds

Reported by: ben@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 1.7.0
Keywords: python, socket Cc: mcalhoun@…, ram@…, blb@…, mww@…, nicdumz@…
Port: python24 python25 python26 python30

Description

OSX's poll is broken. Apple knows this, and removes the HAVE_POLL option as can be seen in the first line of the pyconfig patch here:

 http://www.opensource.apple.com/darwinsource/10.5.6/python-30.1.2/fix/pyconfig.ed

This patch should be applied to all Python builds that MacPorts supports, as it fixes a nasty bug that is being mis-reported all over the place on OSX. Here's one such example of a traceback caused by it:

File "../uploader.py", line 94, in <module>
   resp, data = http.request(post_uri, 'POST', body=content, headers=headers)
 File "build/bdist.macosx-10.5-i386/egg/httplib2/__init__.py", line 1050, in request
 File "build/bdist.macosx-10.5-i386/egg/httplib2/__init__.py", line 854, in _request
 File "build/bdist.macosx-10.5-i386/egg/httplib2/__init__.py", line 823, in _conn_request
 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/httplib.py", line 874, in request
   self._send_request(method, url, body, headers)
 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/httplib.py", line 914, in _send_request
   self.send(body)
 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/httplib.py", line 719, in send
   self.sock.sendall(str)
 File "<string>", line 1, in sendall
socket.error: [Errno 35] Resource temporarily unavailable

And another report caused by the same problem:  http://www.cherrypy.org/ticket/598

Applying the same regexp that Apple does, fixes the problem in my tests.

Credit for finding this bug and its solution should be attributed to Phil Jenvey, I merely bugged him until he found the problem for me. :)

Change History

Changed 3 years ago by mcalhoun@…

  • cc mcalhoun@… added

Cc Me!

Changed 3 years ago by ben@…

This should be clarified, its not 'broken' per se, but merely returns an EAGAIN error rather frequently causing the socket issue, which very very rarely occurs on other platforms. This causes a decent amount of Python code, including httplib2, to throw up the socket 35 error.

Changed 3 years ago by ram@…

  • cc ram@… added

Cc Me!

Changed 3 years ago by jmr@…

  • cc blb@…, mww@… added

Changed 3 years ago by blb@…

  • port set to python24 python25 python26 python30

python26 fixed in r48182.

Changed 3 years ago by blb@…

python24 fixed in r48185.

Changed 3 years ago by blb@…

python30 fixed in r48187.

Changed 3 years ago by nicdumz@…

  • cc nicdumz@… added

Cc Me!

Changed 3 years ago by anonymous

  • milestone Port Bugs deleted

Milestone Port Bugs deleted

Changed 3 years ago by toby@…

  • priority changed from High to Normal

Changed 2 years ago by jmr@…

  • status changed from new to closed
  • resolution set to fixed

Applied to python25 in r60380.

Note: See TracTickets for help on using tickets.