Message218670
| Author |
vstinner |
| Recipients |
georg.brandl, ncoghlan, neologix, pitrou, vstinner |
| Date |
2014年05月16日.15:20:53 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1400253653.52.0.932524063843.issue21515@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> Just catch any OSError?
If possible, I would prefer to not retry O_TMPFILE each time if the kernel version does not support the flag.
Pseudo-code:
--
if o_tmpfile_supported:
try:
fd = os.open(dir, os.O_TMPFILE | ...)
except IsADirectoryError:
# Linux kernel older than 3.11 ignores O_TMPFILE flag
o_tmpfile_supported = False
except OSError:
# the filesystem doesn't support O_TMPFILE
pass
else:
return io.open(fd, ...)
# fallback to unsafe but portable implementation
# current code generating a name and using unlink
--- |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2014年05月16日 15:20:53 | vstinner | set | recipients:
+ vstinner, georg.brandl, ncoghlan, pitrou, neologix |
| 2014年05月16日 15:20:53 | vstinner | set | messageid: <1400253653.52.0.932524063843.issue21515@psf.upfronthosting.co.za> |
| 2014年05月16日 15:20:53 | vstinner | link | issue21515 messages |
| 2014年05月16日 15:20:53 | vstinner | create |
|