STINNER Victor added the comment:

It's difficult to make a choice between Benjamin's PR 3670 and Serhiy's PR 3672.

Benjamin wrote that about his PR:

> No attempt is made to define or provide "reasonable" semantics for iterating
> over a file on multiple threads. (Non-crashing) races are still
> present. Duplicated, corrupt, and missing data will happen.

I'm not confortable with the idea of data corruption. I'm not confortable with 
breaking backward compatibility neither. IMHO the key question is if anyone 
actually use a file object at the same time in multiple threads. Since, it's 
likely that iterating on the same object crash, I'm not sure that anyone do it.

If someone rely on the feature, we should maybe explain how to handle properly 
the issue: use a lock.

I have a preference for Serhiy's PR 3672. It's simple, the error is easy to 
understand. Maybe his PR just lacks a mention in "Porting to Python 2.7" 
section of What's New in Python 2.7 and/or the NEWS entry. Suggest to use a 
lock for example.

----------

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

Reply via email to