Éric Araujo <mer...@netwok.org> added the comment: > This is not a "duplicate issue". The openat solution is no easier than the > os.open > solution.
Amaury did not suggest to use openat, but the new opener argument to open, which was especially added for use cases such as the one discussed here: ... open_exclusive = lambda path, mode: os.open(path, mode|os.O_CREAT|os.O_EXCL)) ... fp = open(filename, 'w', opener=open_exclusive) ... That’s why this bug was initially closed as duplicate. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue12760> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com