[issue5178] Add context manager for temporary directory

2011-09-20 Thread Ugra Dániel
Changes by Ugra Dániel : -- nosy: +daniel.ugra ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue5178] Add context manager for temporary directory

2010-10-26 Thread Nick Coghlan
Nick Coghlan added the comment: Merging the interfaces for mkdtemp and TemporaryDirectory isn't going to happen. mkstemp/mkdtemp are for when the user wants to control the lifecycle of the filesystem entries themselves. (Note that context management on a regular file-like object only closes t

[issue5178] Add context manager for temporary directory

2010-10-25 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Nick, could you comment about my last proposal? -- ___ Python tracker ___ ___ Python-bugs-list ma

[issue5178] Add context manager for temporary directory

2010-10-24 Thread Nick Coghlan
Changes by Nick Coghlan : -- resolution: -> accepted status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue5178] Add context manager for temporary directory

2010-10-24 Thread Nick Coghlan
Nick Coghlan added the comment: Committed (with enhanced tests and a few fixes) in r85818 And credit where it's due to test___all__ for picking up a typo in my adjustment to tempfile.__all__ :) I created issue #10188 to track the shutdown problem. I'm considering taking out the code that att

[issue5178] Add context manager for temporary directory

2010-10-24 Thread Nick Coghlan
Changes by Nick Coghlan : -- assignee: -> ncoghlan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue5178] Add context manager for temporary directory

2010-10-23 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Personally I would like to have a unique tempfile.mkdtemp which can be used as both a function and a context manager, as it happens for open() and others. Not sure how to do that though, unless tempfile.mkdtemp gets turned into a class. There would be objec

[issue5178] Add context manager for temporary directory

2010-10-23 Thread Georg Brandl
Georg Brandl added the comment: Ping... soon it's too late for 3.2 too :) -- nosy: +georg.brandl ___ Python tracker ___ ___ Python-bug

[issue5178] Add context manager for temporary directory

2010-04-28 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

[issue5178] Add context manager for temporary directory

2010-04-28 Thread Nick Coghlan
Nick Coghlan added the comment: Missed the boat for 2.7 I'm afraid. Definitely one to take another look at for 3.2 though. -- assignee: ncoghlan -> versions: -Python 2.7 ___ Python tracker __

[issue5178] Add context manager for temporary directory

2010-01-13 Thread Nick Coghlan
Nick Coghlan added the comment: Building a collection of issues I want to take a look at for 2.7 -- assignee: -> ncoghlan versions: +Python 3.2 -Python 3.1 ___ Python tracker __

[issue5178] Add context manager for temporary directory

2010-01-12 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue5178] Add context manager for temporary directory

2009-03-23 Thread Nick Coghlan
Nick Coghlan added the comment: Unassigning for the moment - I'm still interested in the idea, but the referencing-globals-at-shutdown problem means it isn't going to be the straightforward review-and-commit that I original thought this patch was going to be. I'll still try to get to it before

[issue5178] Add context manager for temporary directory

2009-02-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Maybe there should be a special flag modules can set to make them get > cleared later in the interpreter cleanup procedure. Modules could set > it if they don't create reference cycles themselves and don't hold > references to user objects. Or, perhaps we co

[issue5178] Add context manager for temporary directory

2009-02-14 Thread Neil Schemenauer
Neil Schemenauer added the comment: Argh, it's like pulling a sweater thread. The stat.S_ISDIR function uses the S_IFDIR global so I would have write my own. This does not look like good maintainable code, IMO. Maybe there should be a special flag modules can set to make them get cleared late

[issue5178] Add context manager for temporary directory

2009-02-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: If you look at the code for os.path.isdir, it uses other globals such as os.stat, so you might want to reinject them in your class as well... -- nosy: +pitrou ___ Python tracker __

[issue5178] Add context manager for temporary directory

2009-02-13 Thread Neil Schemenauer
Neil Schemenauer added the comment: New version of the patch. Added a __del__ method that hopefully works reliably. Added NEWS and an example of TemporaryFile as a context manager. I did not change more tests to use TemporaryDirectory since I understand hit-and-run modernization of code is ge

[issue5178] Add context manager for temporary directory

2009-02-07 Thread Nick Coghlan
Changes by Nick Coghlan : -- title: Add content manager for temporary directory -> Add context manager for temporary directory ___ Python tracker ___