Message219132
| Author |
socketpair |
| Recipients |
socketpair |
| Date |
2014年05月26日.05:47:58 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1401083279.44.0.182194375794.issue21579@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2014年05月26日 05:47:59 | socketpair | set | recipients:
+ socketpair |
| 2014年05月26日 05:47:59 | socketpair | set | messageid: <1401083279.44.0.182194375794.issue21579@psf.upfronthosting.co.za> |
| 2014年05月26日 05:47:59 | socketpair | link | issue21579 messages |
| 2014年05月26日 05:47:59 | socketpair | create |
|