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 gregory.p.smith
Recipients gregory.p.smith, pablogsal, ronaldoussoren, serhiy.storchaka, vstinner
Date 2018-09-18.23:38:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1537313884.31.0.956365154283.issue34663@psf.upfronthosting.co.za>
In-reply-to
Content
Give all of this, the lesson I'd take away is perhaps that we should just provide the constant in the os module when available at build time (a configure check) and let people who find a need to use it on their system check for its presence and use it in their code.

The general theme of the posix / os module is intentionally low level:  Expose the APIs and let people make decisions about when to use what at a higher level.

It sounds like a use_vfork=XXX parameter is undesirable at this point unless you wanted to make it clear by its name that it is a glibc only thing feature glibc_use_vfork=XXX perhaps (if exposing the POSIX_SPAWN_USEVFORK flag name itself to be or'ed in is undesirable from a Pythonic API point of view).

The problem with a parameter such named is that you then have to decide on error semantics and need a way for people to know when they can or can't use it prior to calling posix_spawn() itself.

With a constant that you or into flags, you can use hasattr to check the presence of the constant to determine if you can try using it.  (the libc call could still return an error which we'd turn into an OSError exception if the API call doesn't support that flag or otherwise doesn't like the combination of flags you passed - but that situation is always possible in any API)
History
Date User Action Args
2018-09-18 23:38:04gregory.p.smithsetrecipients: + gregory.p.smith, ronaldoussoren, vstinner, serhiy.storchaka, pablogsal
2018-09-18 23:38:04gregory.p.smithsetmessageid: <1537313884.31.0.956365154283.issue34663@psf.upfronthosting.co.za>
2018-09-18 23:38:04gregory.p.smithlinkissue34663 messages
2018-09-18 23:38:04gregory.p.smithcreate