Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue1318] Remove os.tmpnam() and os.tempnam()

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Oct 25, 2007, 10:12 AM

Post #1 of 6 (213 views)
Permalink
[issue1318] Remove os.tmpnam() and os.tempnam()

Martin v. Löwis added the comment:

> 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

----------
title: Remove os.tmpnam() and os.tempnam() [patch] -> Remove os.tmpnam() and os.tempnam()

__________________________________
Tracker <report [at] bugs>
<http://bugs.python.org/issue1318>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 25, 2007, 3:43 PM

Post #2 of 6 (205 views)
Permalink
[issue1318] Remove os.tmpnam() and os.tempnam() [In reply to]

Guido van Rossum added the comment:

Christian can you revise your patch to also remove os.tmpfile per
Martin's request? Make sure unit tests and docs are fixed too.

__________________________________
Tracker <report [at] bugs>
<http://bugs.python.org/issue1318>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 25, 2007, 3:52 PM

Post #3 of 6 (207 views)
Permalink
[issue1318] Remove os.tmpnam() and os.tempnam() [In reply to]

Christian Heimes added the comment:

Guido van Rossum wrote:
> Christian can you revise your patch to also remove os.tmpfile per
> Martin's request? Make sure unit tests and docs are fixed too.

I can do that for you. But I still believe that os.tmpfile() works
different than tempfile.mkstemp(). The former returns a file descriptor
of a file w/o directory entry and the later a file in tempfile.tempdir.

Christian

__________________________________
Tracker <report [at] bugs>
<http://bugs.python.org/issue1318>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 25, 2007, 4:00 PM

Post #4 of 6 (205 views)
Permalink
[issue1318] Remove os.tmpnam() and os.tempnam() [In reply to]

Guido van Rossum added the comment:

2007/10/25, Christian Heimes <report [at] bugs>:
> I can do that for you. But I still believe that os.tmpfile() works
> different than tempfile.mkstemp(). The former returns a file descriptor
> of a file w/o directory entry and the later a file in tempfile.tempdir.

True. But tempfile.TemporaryFile() returns a temp file without a name.

__________________________________
Tracker <report [at] bugs>
<http://bugs.python.org/issue1318>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 25, 2007, 4:00 PM

Post #5 of 6 (201 views)
Permalink
[issue1318] Remove os.tmpnam() and os.tempnam() [In reply to]

Changes by Christian Heimes:


Added file: http://bugs.python.org/file8612/py3k_remove_os_tmp.patch

__________________________________
Tracker <report [at] bugs>
<http://bugs.python.org/issue1318>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 25, 2007, 4:19 PM

Post #6 of 6 (202 views)
Permalink
[issue1318] Remove os.tmpnam() and os.tempnam() [In reply to]

Guido van Rossum added the comment:

Committed revision 58657.

Thanks!

----------
resolution: -> accepted
status: open -> closed

__________________________________
Tracker <report [at] bugs>
<http://bugs.python.org/issue1318>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.