New submission from Gregory P. Smith:

Executing the supplied test code you either get:

sys.version = 3.4.0+ (3.4:635817da596d, Apr 17 2014, 14:30:34) 
[GCC 4.6.3]
--------
Results with <class 'subprocess.Popen'>:
  r0    = None, expected None 
  r1    = None, expected None 
  ri0   = None, expected None 
  ri1   = -9, expected -9 
  ri2   = -9, expected -9 
  r2    = 0, expected -9 *** MISMATCH ***
  r3    = 0, expected -9 *** MISMATCH ***

or

Results with <class 'subprocess.Popen'>:
  r0    = None, expected None 
  r1    = None, expected None 
  ri0   = None, expected None 
  ri1   = -9, expected -9 
  ri2   = -9, expected -9 
  r2    = 0, expected -9 *** MISMATCH ***
  r3    = 0, expected -9 *** MISMATCH ***

At first glance it appears that the .returncode attribute is not safely set 
after the wait call... This test code is using the Popen object from multiple 
threads at once.

----------
assignee: gregory.p.smith
files: subprocess_wait_problem.py
messages: 216757
nosy: gregory.p.smith
priority: normal
severity: normal
status: open
title: subprocess Popen objects are not thread safe w.r.t. wait() and 
returncode being set
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file34955/subprocess_wait_problem.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21291>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to