New submission from mj4int <michael.john...@intel.com>:

A pool of threads exists, all of which have started executing.

Thread A has a fileinput object and is currently iterating over the files in 
"edit in place mode".  For each file, stdout is redirected to the file.  Thread 
A can call print and write to the file.

Thread B just wants to log some things in the console.  Thread B calls print 
and... writes to the file thread A is processing.  stdout is hijacked by thread 
A's fileinput loop.

Whether or not every thread should have an independent evaluation of stdout, 
certainly a fileinput object shouldn't silently redirect the prints of an 
innocent bystander thread?

May exist in other python versions, but not checked.

----------
components: IO, Library (Lib)
messages: 312516
nosy: mj4int
priority: normal
severity: normal
status: open
title: FileInput "inplace" redirects output of other threads
type: behavior
versions: Python 2.7, Python 3.5

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

Reply via email to