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 serhiy.storchaka
Recipients bignose, eryksun, ethan.furman, georg.brandl, gumnos, r.david.murray, serhiy.storchaka
Date 2017-05-01.19:00:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1493665255.41.0.899330762082.issue26362@psf.upfronthosting.co.za>
In-reply-to
Content
>  temp_name = tempfile.mktemp(dir=".")
>  os.link("a", temp_name)

There is a race condition between generating file name and using it. tempfile.mktemp() is not much more useful that just a function that generates some names which unlikely matches the names of existing files the directory. In any case you should catch an error and repeat an attempt with different name. How much attempts to do and what additional checks to do is an application specific.
History
Date User Action Args
2017-05-01 19:00:55serhiy.storchakasetrecipients: + serhiy.storchaka, georg.brandl, gumnos, r.david.murray, ethan.furman, bignose, eryksun
2017-05-01 19:00:55serhiy.storchakasetmessageid: <1493665255.41.0.899330762082.issue26362@psf.upfronthosting.co.za>
2017-05-01 19:00:55serhiy.storchakalinkissue26362 messages
2017-05-01 19:00:55serhiy.storchakacreate