Skip to content

env vars passed to spawn are not visible in child process #69

@saukap

Description

@saukap

Describe the bug
wexpect.spawn takes an optional parameter env but doesn't propagate those env vars it to the child process.

To Reproduce
Steps to reproduce the behavior:

Run the following script:

p = wexpect.spawn('cmd', env={'NAME': 'VALUE'})
p.expect('>')
p.sendline('echo %NAME%')
p.expect('>')
print(p.before.splitlines()[1])

Observed output: %NAME%

Expected behavior
VALUE is output

Screenshots
If applicable, add screenshots to help explain your problem.

Environment:

  • Windows 10
  • 3.10
  • 4.0.0

Additional context
None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions