New submission from Марк Коренберг:

Suppose code:
=====================================
import os
import tempfile

want_to_replace = 'zxc.dat'
tmpdir=os.path.dirname(os.path.realpath(want_to_replace))
with tempfile.NamedTemporaryFile(dir=tmpdir) as fff:
    # do somewhat with fff here... and then:
    fff.flush()
    os.fdatasync(fff)
    os.rename(fff.name, want_to_replace)
    fff.delete = False
=====================================
In python 3.3 and lower that works FINE. In Python 3.4 the fff._closer 
attribute was introduced, so fff.close=False stopped to work. I think this is 
major loss of functionality. The "close" attribute was not marked as private, 
so may be used in past.

----------
components: Library (Lib)
messages: 219132
nosy: mmarkk
priority: normal
severity: normal
status: open
title: Python 3.4: tempfile.close attribute does not work
type: behavior
versions: Python 3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21579>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to