Issue 14515: tempfile.TemporaryDirectory documented as returning object but returns name (original) (raw)

Created on 2012-04-06 02:07 by r.david.murray, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
tempdir-doc.patch r.david.murray,2012-04-11 17:48 review
Messages (9)
msg157635 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-04-06 02:07
The title pretty much says it all. I believe the behavior is correct (more useful than returning an object that is only useful for obtaining the name) even though it is unusual for context managers. In any case there is plenty of code using the existing behavior, so I think this is a doc bug.
msg158063 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-04-11 17:48
I misread the docs. They aren't wrong, but it is still the case that they don't mention that the directory name is what you get on entry to the context, which is what led to my confusion. Here's a patch.
msg158100 - (view) Author: Alyssa Coghlan (ncoghlan) * (Python committer) Date: 2012-04-12 02:09
Change looks fine to me - go ahead and commit it :)
msg182117 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-02-14 19:16
I don't understand a phrase "and is assigned to the target of the as clause on entry to a context". Typo?
msg182121 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-02-14 21:18
The patch is missing the markup for the 'as' keyword (it should read :keyword:`as`). If that were added, would the sentence make sense to you? Would it be clearer to say that the directory name is returned by the __enter__ method?
msg182122 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-02-14 21:29
Aha, now it makes a sense to me. I don't know which variant will be clear.
msg209840 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2014-01-31 22:26
bump?
msg210344 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-02-05 19:56
New changeset b5fe07d39e16 by R David Murray in branch '3.3': #14515: clarify that TemporaryDirectory's __enter__ returns the name. http://hg.python.org/cpython/rev/b5fe07d39e16 New changeset 7b7e17723787 by R David Murray in branch 'default': #14515: clarify that TemporaryDirectory's __enter__ returns the name. http://hg.python.org/cpython/rev/7b7e17723787
msg210345 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-02-05 19:58
Just ran into this again :). Committed a patch with wording clarified based on Serhiy's feedback (I say 'target of the as clause of the with statement'.)
History
Date User Action Args
2022-04-11 14:57:28 admin set github: 58720
2014-02-05 19:58:09 r.david.murray set status: open -> closedmessages: + stage: patch review -> resolved
2014-02-05 19:56:52 python-dev set nosy: + python-devmessages: +
2014-01-31 22:26:19 yselivanov set nosy: + yselivanovmessages: +
2013-03-14 08:17:45 ezio.melotti set nosy: + terry.reedy, ezio.melottistage: needs patch -> patch reviewversions: + Python 3.4
2013-02-14 21:29:32 serhiy.storchaka set messages: +
2013-02-14 21🔞05 r.david.murray set messages: +
2013-02-14 19:16:10 serhiy.storchaka set nosy: + serhiy.storchakamessages: +
2012-04-12 02:09:55 ncoghlan set messages: +
2012-04-11 17:48:06 r.david.murray set files: + tempdir-doc.patchnosy: + ncoghlanmessages: + keywords: + patch
2012-04-06 02:07:47 r.david.murray create