[issue31471] assertion failure in subprocess.Popen() in case the env arg has a bad keys() method

2017-09-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks Oren!

--
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



[issue31471] assertion failure in subprocess.Popen() in case the env arg has a bad keys() method

2017-09-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset c7f165fe652651c32833245fc902c790a4f173fa by Serhiy Storchaka 
(Oren Milman) in branch '2.7':
[2.7] bpo-31471: Fix assertion failure in subprocess.Popen() on Windows, in 
case env has a bad keys() method. (GH-3580) (#3595)
https://github.com/python/cpython/commit/c7f165fe652651c32833245fc902c790a4f173fa


--

___
Python tracker 

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



[issue31471] assertion failure in subprocess.Popen() in case the env arg has a bad keys() method

2017-09-15 Thread Oren Milman

Changes by Oren Milman :


--
pull_requests: +3586

___
Python tracker 

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



[issue31471] assertion failure in subprocess.Popen() in case the env arg has a bad keys() method

2017-09-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It's on you.

--

___
Python tracker 

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



[issue31471] assertion failure in subprocess.Popen() in case the env arg has a bad keys() method

2017-09-15 Thread Oren Milman

Oren Milman added the comment:

OK.
but there isn't an assertion failure to test in 2.7, so is adding a test
still relevant?

--

___
Python tracker 

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



[issue31471] assertion failure in subprocess.Popen() in case the env arg has a bad keys() method

2017-09-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Then I think it is worth to backport the fix to 2.7.

--
versions: +Python 2.7

___
Python tracker 

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



[issue31471] assertion failure in subprocess.Popen() in case the env arg has a bad keys() method

2017-09-14 Thread Oren Milman

Oren Milman added the comment:

in 2.7 getenvironment() is in PC/_subprocess.c, and it also calls 
PyMapping_Values()
immediately after calling PyMapping_Keys().
however, _PyObject_FastCallDict() doesn't exist here.
in case of an error in both PyMapping_Keys() and PyMapping_Values(), the
error in PyMapping_Values() just overwrites the error in PyMapping_Keys().

but I haven't gone over all of the code that could be run as part of
PyMapping_Values(), so I am not sure whether something could go wrong in case 
PyMapping_Keys() failed.

--

___
Python tracker 

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



[issue31471] assertion failure in subprocess.Popen() in case the env arg has a bad keys() method

2017-09-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset f135f62cfd1529cbb9326e53728a22afd05b6bc3 by Serhiy Storchaka 
(Miss Islington (bot)) in branch '3.6':
[3.6] bpo-31471: Fix assertion failure in subprocess.Popen() on Windows, in 
case env has a bad keys() method. (GH-3580) (#3584)
https://github.com/python/cpython/commit/f135f62cfd1529cbb9326e53728a22afd05b6bc3


--

___
Python tracker 

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



[issue31471] assertion failure in subprocess.Popen() in case the env arg has a bad keys() method

2017-09-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Is this bug reproducible in 2.7?

--
versions: +Python 3.6

___
Python tracker 

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



[issue31471] assertion failure in subprocess.Popen() in case the env arg has a bad keys() method

2017-09-14 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +3575

___
Python tracker 

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



[issue31471] assertion failure in subprocess.Popen() in case the env arg has a bad keys() method

2017-09-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 0b3a87ef54a0112b74e8a1d8c6f87d10db4239ab by Serhiy Storchaka 
(Oren Milman) in branch 'master':
bpo-31471: Fix assertion failure in subprocess.Popen() on Windows, in case env 
has a bad keys() method. (#3580)
https://github.com/python/cpython/commit/0b3a87ef54a0112b74e8a1d8c6f87d10db4239ab


--

___
Python tracker 

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



[issue31471] assertion failure in subprocess.Popen() in case the env arg has a bad keys() method

2017-09-14 Thread Oren Milman

Changes by Oren Milman :


--
keywords: +patch
pull_requests: +3570
stage: needs patch -> patch review

___
Python tracker 

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



[issue31471] assertion failure in subprocess.Popen() in case the env arg has a bad keys() method

2017-09-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage:  -> needs patch

___
Python tracker 

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



[issue31471] assertion failure in subprocess.Popen() in case the env arg has a bad keys() method

2017-09-14 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo, serhiy.storchaka

___
Python tracker 

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



[issue31471] assertion failure in subprocess.Popen() in case the env arg has a bad keys() method

2017-09-14 Thread Oren Milman

New submission from Oren Milman:

The following code causes an assertion failure on Windows:
class BadEnv(dict):
keys = None

import subprocess

import sys

subprocess.Popen([sys.executable, "-c", "pass"], env=BadEnv())


this is because getenvironment() (in Modules/_winapi.c) calls PyMapping_Values()
immediately after calling PyMapping_Keys().
calling PyMapping_Values() ultimately leads to calling _PyObject_FastCallDict(),
which does 'assert(!PyErr_Occurred());'.
thus, in case of an error in PyMapping_Keys(), the assertion fails.

--
components: Extension Modules
messages: 302181
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: assertion failure in subprocess.Popen() in case the env arg has a bad 
keys() method
type: crash
versions: Python 3.7

___
Python tracker 

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