Christoph Böddeker added the comment:

I had a problem that can be solved with the presented change.  
But I had also problems to reproduce it in a small example.
I am not sure if a test is allowed to depend on external libraries.

The code at the end executed with
    mpirun -np 3 python test.py
always breaks with the current code of pathlib and works with the fix.

Maybe this helps to write a test and shows a usecase where this fix is 
necessary.

P.S.: I was not able to produce the error with multiprosessing.

from mpi4py import MPI
from pathlib import Path
import tempfile

comm = MPI.COMM_WORLD
rank = comm.rank
size = comm.size

with tempfile.TemporaryDirectory() as tmp_dir:

    tmp_dir = comm.bcast(tmp_dir, root=0)
    p = Path(tmp_dir) / 'a' / 'b'
    comm.barrier()
    p.mkdir(parents=True, exist_ok=True)

----------
nosy: +Christoph Böddeker

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

Reply via email to