This should be done like this:
```
env = dict(os.environ)
env['HOME'] = ...
```