[Pythonmac-SIG] urllib2.urlopen fails in a forked daemon with a CoreFoundation error

Bill Janssen janssen at parc.com
Sun Mar 15 20:13:35 CET 2009

You need to do an "exec" after doing a "fork".  /usr/bin/python on OS X
is a "framework build", and some (most?) of the OS X frameworks just
don't work after doing a fork.  You have to restart with an "exec".

It's hard to say just what is using CF; I see you're importing some
external packages ("json" doesn't come with 2.5.1 on OS X), so it might
be one of them, instead of urllib2.  But it's probably the "urllib"
module, which uses CF to call into the SystemConfiguration system on the
Mac to look up proxies and such.  It would make sense that the error
is triggered just when you call urlopen().


More information about the Pythonmac-SIG mailing list