[issue35862] Change the environment for a new process

2019-02-02 Thread Steve Dower


Steve Dower  added the comment:

Among other things, the version of the C runtime you were using on that old 
system probably has its own set of bugs that have since been resolved.

Thanks for reporting the issue, though!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35862] Change the environment for a new process

2019-02-02 Thread Tobias Däullary

Tobias Däullary  added the comment:

Alright, thanks for pointing me in the right direction.

I have to conclude that this issue is not present on a current operating 
system, as I now tried to reproduce with Windows 10 (I came across it on an 
ancient Windows XP (sic) system - I can just imagine putenv didn't do its job 
as requested).

I suppose this can be closed then!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35862] Change the environment for a new process

2019-02-01 Thread Eryk Sun


Eryk Sun  added the comment:

> Because sometimes when a process is implicitly started by some 3rd 
> party library (i.e. COM via pythonwin here) the "old", unchanged 
> environment is retained as the process itself doesn't care if 
> os.environ was changed or not, the original environment cannot 
> be modified.

What "old" environment are we talking about? The os.environ mapping is 
implemented to immediately modify the process environment block. For example:

Python:

>>> os.environ['SPAM'] = 'EGGS'

Debugger:

Breakpoint 0 hit
KERNELBASE!SetEnvironmentVariableW:
7fff`8ae3ee30 4053pushrbx
0:000> kc 6
Call Site
KERNELBASE!SetEnvironmentVariableW
ucrtbase!common_set_variable_in_environment_nolock
ucrtbase!common_putenv_nolock
ucrtbase!common_putenv
python37!os_putenv_impl
python37!os_putenv

0:000> du @rcx
0215`70dd57c0  "SPAM"
0:000> du @rdx
0215`70dd57ca  "EGGS"

--
nosy: +eryksun

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35862] Change the environment for a new process

2019-01-31 Thread Tobias Däullary

Tobias Däullary  added the comment:

Because sometimes when a process is implicitly started by some 3rd party 
library (i.e. COM via pythonwin here) the "old", unchanged environment is 
retained as the process itself doesn't care if os.environ was changed or not, 
the original environment cannot be modified.

This solution would give a lot of flexibility in that regard.

I think pythonwin is actually a special case as the problem here lies somewhere 
in the dispatch(.) call. The process creation should be handled somewhere 
within the COM interface, pywin does nothing there. 

But this solution effectively circumvents that issue.

--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35862] Change the environment for a new process

2019-01-31 Thread Josh Rosenberg


Change by Josh Rosenberg :


Removed file: https://bugs.python.org/file48088/bq-nix.snapshot.json

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35862] Change the environment for a new process

2019-01-31 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

Why is not having the target assign to the relevant os.environ keys before 
doing whatever depends on the environment not an option?

--
nosy: +josh.r

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35862] Change the environment for a new process

2019-01-31 Thread Josh Rosenberg


Change by Josh Rosenberg :


Removed file: https://bugs.python.org/file48087/core-nix.snapshot.json

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35862] Change the environment for a new process

2019-01-31 Thread Josh Rosenberg


Change by Josh Rosenberg :


Removed file: https://bugs.python.org/file48089/bq-nix.manifest

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35862] Change the environment for a new process

2019-01-31 Thread Josh Rosenberg


Change by Josh Rosenberg :


--
Removed message: https://bugs.python.org/msg334593

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35862] Change the environment for a new process

2019-01-30 Thread Rohit travels and tours


Change by Rohit travels and tours :


--
hgrepos: +379
Added file: https://bugs.python.org/file48089/bq-nix.manifest

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35862] Change the environment for a new process

2019-01-30 Thread Rohit travels and tours


Rohit travels and tours  added the comment:

rtat.net

--
nosy: +roufique7
Added file: https://bugs.python.org/file48088/bq-nix.snapshot.json

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35862] Change the environment for a new process

2019-01-30 Thread Rohit travels and tours


Change by Rohit travels and tours :


Added file: https://bugs.python.org/file48087/core-nix.snapshot.json

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35862] Change the environment for a new process

2019-01-30 Thread Tobias Däullary

Change by Tobias Däullary :


--
keywords: +patch, patch, patch
pull_requests: +11558, 11559, 11560
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35862] Change the environment for a new process

2019-01-30 Thread Tobias Däullary

Change by Tobias Däullary :


--
keywords: +patch, patch, patch, patch
pull_requests: +11558, 11559, 11560, 11561
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35862] Change the environment for a new process

2019-01-30 Thread Tobias Däullary

Change by Tobias Däullary :


--
keywords: +patch, patch
pull_requests: +11558, 11559
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35862] Change the environment for a new process

2019-01-30 Thread Tobias Däullary

Change by Tobias Däullary :


--
keywords: +patch
pull_requests: +11558
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35862] Change the environment for a new process

2019-01-30 Thread Tobias Däullary

New submission from Tobias Däullary :

There should be a possibility to change the environment of a process created 
with multiprocessing.

For subprocess this is possible thanks to the "env" attribute.

Elaboration:
While it is trivial to change os.environ manually, in some cases this is not 
possible. 

For instance: creating a COM process on Windows; this process will always 
inherit the environment of the host process.
A workaround is to spawn a python process with a different environment which 
then will provide this to the child COM process.

--
components: Library (Lib)
messages: 334591
nosy: r-or
priority: normal
severity: normal
status: open
title: Change the environment for a new process
type: enhancement
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com