[issue5178] Add context manager for temporary directory

2011-09-20 Thread Ugra Dániel
Changes by Ugra Dániel daniel.u...@gmail.com: -- nosy: +daniel.ugra ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5178 ___ ___ Python-bugs-list

[issue5178] Add context manager for temporary directory

2010-10-26 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com 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

[issue5178] Add context manager for temporary directory

2010-10-25 Thread Giampaolo Rodola'
Giampaolo Rodola' g.rod...@gmail.com added the comment: Nick, could you comment about my last proposal? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5178 ___

[issue5178] Add context manager for temporary directory

2010-10-24 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- assignee: - ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5178 ___ ___ Python-bugs-list

[issue5178] Add context manager for temporary directory

2010-10-24 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com 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

[issue5178] Add context manager for temporary directory

2010-10-24 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- resolution: - accepted status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5178 ___

[issue5178] Add context manager for temporary directory

2010-10-23 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: Ping... soon it's too late for 3.2 too :) -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5178 ___

[issue5178] Add context manager for temporary directory

2010-10-23 Thread Giampaolo Rodola'
Giampaolo Rodola' g.rod...@gmail.com 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.

[issue5178] Add context manager for temporary directory

2010-04-28 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com 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 rep...@bugs.python.org

[issue5178] Add context manager for temporary directory

2010-04-28 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- nosy: +giampaolo.rodola ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5178 ___ ___

[issue5178] Add context manager for temporary directory

2010-01-13 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com 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 rep...@bugs.python.org http://bugs.python.org/issue5178

[issue5178] Add context manager for temporary directory

2010-01-12 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5178 ___ ___ Python-bugs-list

[issue5178] Add context manager for temporary directory

2009-03-23 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com 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

[issue5178] Add context manager for temporary directory

2009-02-14 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr 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 rep...@bugs.python.org

[issue5178] Add context manager for temporary directory

2009-02-14 Thread Neil Schemenauer
Neil Schemenauer nas-pyt...@arctrix.com 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

[issue5178] Add context manager for temporary directory

2009-02-14 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr 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,

[issue5178] Add context manager for temporary directory

2009-02-13 Thread Neil Schemenauer
Neil Schemenauer nas-pyt...@arctrix.com 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

[issue5178] Add context manager for temporary directory

2009-02-07 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- title: Add content manager for temporary directory - Add context manager for temporary directory ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5178