PolyChord / PolyChordLite

Public version of PolyChord: See polychord.co.uk for PolyChordPro
https://polychord.io/
Other
83 stars 26 forks source link

Possible race condition in the Python interface #1

Closed JesusTorrado closed 5 years ago

JesusTorrado commented 5 years ago

Hi Will,

There is a potential race condition in the Python wrapper, when creating the base and clusters folders. Maybe the following patch would help: https://github.com/CobayaSampler/cobaya/issues/9#issuecomment-443725167

Cheers Jesús

PS: Still haven't had time to update PolyChord to pull from this repo. Coming very soon!

williamjameshandley commented 5 years ago

I agree that this should fix the race condition if it arises.

Another way to address this issue would be to put the try statement around the makedirs, command, although to catch these you would need either OSError or FileNotFoundError, depending on python2 or 3

Feel free to submit a PR.