Skip to content

asyncio.create_subprocess_exec/shell() doesn't allow passing some explicit default arguements (i.e. cwd=None, env=None) #43

Description

@tapetersen

Passing arguments that are documented defaults for Popen? (such as cwdandenvwhich defaults toNone`) raises an exception while leaving them blank works.

Following small test-program demonstrates it:

import rsloop
import asyncio
async def main():
            await asyncio.create_subprocess_exec(
                sys.executable,
                "-c",
                "import sys;sys.exit(0)",
                cwd=None,
                env=None,
                executable=None,
                umask=-1,
            )
rsloop.run(main()) # TypeError: expected str, bytes or os.PathLike object, not NoneType

At least anyio passes cwd and env explicitly set to None. executable and umask was reported as potentially problematic as well by AI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions