[issue11700] mailbox.py proxy updates

2011-06-17 Thread Roundup Robot
Roundup Robot added the comment: New changeset b89d193cbca5 by R David Murray in branch '2.7': #11700: proxy object close methods can now be called multiple times http://hg.python.org/cpython/rev/b89d193cbca5 New changeset 8319db2dd342 by R David Murray in branch '3.2': #11700: proxy object clo

[issue11700] mailbox.py proxy updates

2011-05-24 Thread Steffen Daode Nurpmeso
Changes by Steffen Daode Nurpmeso : Removed file: http://bugs.python.org/file22095/11700.yeah-review.diff ___ Python tracker ___ ___ Python-bu

[issue11700] mailbox.py proxy updates

2011-05-24 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso added the comment: Hello, David, i'm about to remind you that this issue is still open (and the next release is about to come soon). I think we do agree at least in the fact that this is a bug :). Well, your mailbox_close_twice.patch no. 2 still imports on the current tip.

[issue11700] mailbox.py proxy updates

2011-04-17 Thread R. David Murray
R. David Murray added the comment: Updated patch addressing Stefen and Ezio's comments. -- Added file: http://bugs.python.org/file21699/mailbox_close_twice.patch ___ Python tracker

[issue11700] mailbox.py proxy updates

2011-04-17 Thread R. David Murray
R. David Murray added the comment: Ah. Well, since the io module and its classes didn't exist when that code in mailbox.py was written, no, that's not what happened :) Nor does 'file like object' in Python necessarily mean conformance to the io specification. We are *tending* in that direct

[issue11700] mailbox.py proxy updates

2011-04-17 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso added the comment: On Sat, Apr 16, 2011 at 08:17:30PM +, R. David Murray wrote: > [...] rather odd considering that there is also a 'closed' > method that would fail similarly if close was ever called. Maybe someone got not enough feedback after she wrote the patch.

[issue11700] mailbox.py proxy updates

2011-04-16 Thread R. David Murray
R. David Murray added the comment: Here's a patch that fixes the reported bug (calling close twice fails with an AttributeError) the simple way. Note that there was actually a test for the buggy behavior, which is rather odd considering that there is also a 'closed' method that would fail sim

[issue11700] mailbox.py proxy updates

2011-04-13 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso added the comment: Amaury Forgeot d'Arc wrote: > mbf.close() should not fail when called twice. The close() method in the > io > module states that "This method has no effect if the file is already > > closed." > But then, is "close=False" necessary? I see you've detach

[issue11700] mailbox.py proxy updates

2011-04-10 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso added the comment: I reviewed this. And moved a _PartialFile-only _read() case to _PartialFile where it belongs (*this* _ProxyFile will never be extended to stand alone so i shouldn't have moved that the other direction at all). -- Added file: http://bugs.python.o

[issue11700] mailbox.py proxy updates

2011-04-09 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso added the comment: .. > So here is the rewritten .yeah-2.diff. .. > I added more tests (i'm absolutely convinced that the tests i've > found in test_mailbox.py really find all the cutting edges <;). > On my box this is clean. Haha, now this is *very* funny! __ Tr

[issue11700] mailbox.py proxy updates

2011-04-08 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso added the comment: (Hrmpf, it seems a '>>> class y(io.RawIOBase):' line has been swallowed in at least Roundup.) So here is the rewritten .yeah-2.diff. It drops the ._trackpos stuff once again due to problems with position tracking in case of failures, i.e. to go that

[issue11700] mailbox.py proxy updates

2011-04-07 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso added the comment: On Thu, Apr 07, 2011 at 04:41:52PM +, R. David Murray wrote: > > R. David Murray added the comment: > > I don't understand what you are saying about raising a ValueError on close. > f = open('x'); f.close(); f.close() does not raise any error, as

[issue11700] mailbox.py proxy updates

2011-04-07 Thread R. David Murray
R. David Murray added the comment: I don't understand what you are saying about raising a ValueError on close. f = open('x'); f.close(); f.close() does not raise any error, as Amaury pointed out. So I still don't understand the motivation for a more complex fix. --

[issue11700] mailbox.py proxy updates

2011-04-07 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso added the comment: On Thu, Apr 07, 2011 at 01:12:46AM +, R. David Murray wrote: > [...] should be sufficient. It is sufficient to fix the resource warning. Having a completely dynamic language is a nice thing. I would not do it like that. Instead i would even conside

[issue11700] mailbox.py proxy updates

2011-04-06 Thread R. David Murray
R. David Murray added the comment: Given your problem report wouldn't the simplest solution be to change the close method to be: if hasattr(self, '_file'): if hasattr(self._file, 'close'): self._file.close() del self._file As for a test, it seems to me that adding

[issue11700] mailbox.py proxy updates

2011-03-29 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso added the comment: This new patch adheres your suggestion. Now all implemented operations perform a "file is open at all" check and raise ValueError if not, which somewhat reflects what i've seen when i was looking into fileio.c. My questions: - shouldn't _ProxyFile inher

[issue11700] mailbox.py proxy updates

2011-03-29 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso added the comment: On Mon, Mar 28, 2011 at 09:52:43PM +, Amaury Forgeot d'Arc wrote: > But then, is "close=False" necessary? It's about 'class _PartialFile(_ProxyFile)', for which this argument is always false. Alternatively there could be a "protected" _ProxyFile._

[issue11700] mailbox.py proxy updates

2011-03-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: mbf.close() should not fail when called twice. The close() method in the io module states that "This method has no effect if the file is already closed." But then, is "close=False" necessary? -- nosy: +amaury.forgeotdarc stage: -> patch review

[issue11700] mailbox.py proxy updates

2011-03-28 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso added the comment: Here's the patch. -- keywords: +patch Added file: http://bugs.python.org/file21438/11700.1.diff ___ Python tracker ___diff --git a/Lib/

[issue11700] mailbox.py proxy updates

2011-03-28 Thread Steffen Daode Nurpmeso
New submission from Steffen Daode Nurpmeso : I'll send a patch that updates/fixes handling of file closes in the internal proxy-file classes. It could cause errors yet because self._file is del-eted but that field may still be used afterwards. >>> mb = mailbox.Maildir('sdaoden', create=False) >