This is more likely a Python thing. Few understand the design decisions behindf Python or the effects they have on deployment. For example, if you use CherryPy which is threaded, you can borrow a lot of trouble by trying to use ZEO with it if you do it at the wrong level. Python process with 100 threads on a 32 processor machine will be executing ONE of its threads at any given time, and loading only one processor. This is almost counterintuitive for anyone who has a Java background, but back at Python 1.5, there was a version produced without the Global Interpreter Lock, which ran at half-speed on Windows (and would have done worse on Linux). The Global Interpreter Lock on Python is a design decision the Python folks made. As one person mentioned, TurboGears has to be run in load-balanced multiple processes to be efficient on a server, because it uses a threaded model.
Act 2: Fork() on a threaded Python is sometimes deadly. This seems to be because _execv() which is where all good forks eventually go, imports errno. Moving that import to the top of os.py and changing a couple of function references seems to clear that problem, but without alleviating the fact that the forked process and the thread that forked it may be competing for the same lock at some point--resulting in a deadlock or livelock. But this does not seem to be from threads, and it is not from Django. It appears that you have selected flup's threadedserver instead of the preforkserver, and there the warning should arise? grep -e (various strings) -r /usr/lib/python2.4/ and of flup/ itself were unrevealing. There were matches in .pyo and .pyc files which I could not view. TurboGears, CherryPy, and Twisted all had hits on "MUST exec()" in addition to flup. Twisted uses its own threadlets but TG and CP are threaded. HTH I have a unified diff to fix the os.py problem for 2.4 if you want it. Just write to me off-list. I could produce one easily for 2.5 as well. > > I'm using the urllib module to do some backend transactions. I'm > integrating paypal, and some other tools. > > In using the name-value-pairs of the paypal API's express checkout, I > need to send some params to an API url. > > I do it like this within a function called by a view, where nvp is a > dict of all my params >>>> API_ENDPOINT = 'https://api-3t.sandbox.paypal.com/nvp' >>>> encodedParams = urllib.urlencode(nvp) >>>> response = urllib.urlopen(API_ENDPOINT, encodedParams).read() > > This works fine from a command line, but spits out this message many > times: > The process has forked and you cannot use this CoreFoundation > functionality safely. You MUST exec(). > Break on > __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__() > to debug. > > > What is that about? Might it be an issue with my development > environment under OS X 10.5, or is it a Django thing? > > I'm using lightpd w/ flup for fcgi. > > Thanks, > Ivan > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---

