This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Marc.Liyanage
Recipients Marc.Liyanage, jnoller, sbt
Date 2013-11-01.19:53:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1383335608.62.0.190972038385.issue19478@psf.upfronthosting.co.za>
In-reply-to
Content
I'm running Python 2.7 in a sandboxed OS X app. There are restrictions on the naming of POSIX semaphores when running in the sandbox. Specifically, there is a mandatory prefix.

I would like the ability to inject this prefix into the part of the multiprocessing module that creates the semaphore, perhaps by way of an environment variable.

I see that this is how the module generates the semaphore name:

    PyOS_snprintf(buffer, sizeof(buffer), "/mp%ld-%d", (long)getpid(), counter++);

Apple's documentation about the restrictions are here:

https://developer.apple.com/library/mac/documentation/security/conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW24

The relevant part:

"POSIX semaphores and shared memory names must begin with the application group identifier, followed by a slash (/), followed by a name of your choosing."

So if I could inject that string before the leasing slash, I could make this work.
History
Date User Action Args
2013-11-01 19:53:28Marc.Liyanagesetrecipients: + Marc.Liyanage, jnoller, sbt
2013-11-01 19:53:28Marc.Liyanagesetmessageid: <1383335608.62.0.190972038385.issue19478@psf.upfronthosting.co.za>
2013-11-01 19:53:28Marc.Liyanagelinkissue19478 messages
2013-11-01 19:53:28Marc.Liyanagecreate