Message56750
| Author |
loewis |
| Recipients |
christian.heimes, gvanrossum, loewis |
| Date |
2007年10月25日.17:12:02 |
| SpamBayes Score |
0.00026490167 |
| Marked as misclassified |
No |
| Message-id |
<4720CE60.3080509@v.loewis.de> |
| In-reply-to |
<1193305469.47.0.0144353397817.issue1318@psf.upfronthosting.co.za> |
| Content |
> os.tmpfile() is the only method that has no duplicate in tempfile.
Why do you say that? tempfile.mkstemp() does essentially the same
as os.tmpfile().
> The promise of tempfile.mkstemp is also bogus for every OS except
> Windows. IIRC only Windows supports O_NOINHERIT.
Please read the code. It tries to set the CLOEXEC flag on Unix,
which should work on most systems.
> Let me rephrase the rational for my patch: I want to remove duplicate
> code to have just but one implementation to create a temporary file
> (name). I want the one implementation be under our control and not
> depend on some possible broken or stupid C library like Windows where
> tmpnam may create the temporary files in C:\. I want an unified way to
> get the TEMP dir independent of the API.
As I said, I agree with most of this rationale, except that I'm
uncertain whether it is good to trade a stupid C library for a
stupid Python implementation.
With this rationale, again, I think tmpfile should be removed as
well.
Regards,
Martin |
|