[win32] Permission denied in fancy_rename

Aaron Bentley aaron.bentley at utoronto.ca
Thu May 4 01:19:46 BST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert Collins wrote:
| On Wed, 2006-05-03 at 19:34 -0400, Aaron Bentley wrote:
|>Or, to put it another way, finalizing iterators isn't a responsibility
|>of get_bytes.  It must be done in the calling code.
|
|
| Because of our problems with open files on windows, I think we must
| define the interface of the return value of get_bytes *so that* the
| calling code can fulfil that responsibility.

I actually meant put_bytes.  The caller can take full responsibility for
closing a file it provides.

For get_bytes, if transports supported finalization, I would suggest
putting iterator finalization there.  Since they don't, the options I
can see are
1. Don't use file-backed iterators on Windows
2. Require that callers always exhaust the iterator, and have iterators
close themselves when exhausted
3. Provide an explicit close method on all returned iterables, which may
be a dummy.

I believe that any of the above is better than requiring returned
objects to support the full file interface.

It's nice that they're addressing this via the 'with' statement in
Python 2.5.

Aaron

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFEWUii0F+nu1YWqI0RArHKAJ0XEWvaEcwZ79vqeOibrpR9qQuJLACdGS8o
/CJPQSzQ0ZrjojpOZkKSdFE=
=RI9g
-----END PGP SIGNATURE-----




More information about the bazaar mailing list