NicolasHug / Surprise

A Python scikit for building and analyzing recommender systems
http://surpriselib.com
BSD 3-Clause "New" or "Revised" License
6.4k stars 1.01k forks source link

Fix FilexExistsError due to race condition #359

Closed lrebscher closed 4 years ago

lrebscher commented 4 years ago

I did not use os.makedirs(folder, exist_ok=True) as exist_ok is only available with Python 3.4+. Implemented solution works for both Python 3.x and Python 2.7 (https://stackoverflow.com/a/42545343).

Exceptions due to race condition are not deterministic, thus I did not write a test for it. However, existing tests cover the code changes and pass. Also, the FileExistsError does not occur in my setup anymore.

lrebscher commented 4 years ago

@NicolasHug would be glad if you could review the PR :)

MeTaNoV commented 4 years ago

@NicolasHug (thx @lrebscher), can we move forward on that one since it is disturbing a lot our build process...

NicolasHug commented 4 years ago

Thanks for the PR @lrebscher

MeTaNoV commented 4 years ago

@lrebscher @NicolasHug thanks for your time, is it possible to get a v1.1.1 in the mix? ;)

NicolasHug commented 4 years ago

I released 1.1.1

MeTaNoV commented 4 years ago

I released 1.1.1

Thanks @NicolasHug !