This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients benjamin.peterson, gvanrossum, lemburg, pitrou, serhiy.storchaka, vstinner
Date 2017-09-25.09:14:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1506330875.06.0.690599430254.issue31530@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-09-25 09:14:35vstinnersetrecipients: + vstinner, lemburg, gvanrossum, pitrou, benjamin.peterson, serhiy.storchaka
2017-09-25 09:14:35vstinnersetmessageid: <1506330875.06.0.690599430254.issue31530@psf.upfronthosting.co.za>
2017-09-25 09:14:35vstinnerlinkissue31530 messages
2017-09-25 09:14:34vstinnercreate