[MERGE] Cleanup and test Lock objects

John Arbash Meinel john at arbash-meinel.com
Wed Mar 14 14:43:01 GMT 2007


Martin Pool wrote:
> Martin Pool has voted +1.
> Status is now: Approved
> Comment:
> +    _fmt = "Cannot acquire write lock on %(fname)s. File is readonly."
> 
> Adding a specific exception class sounds good.  I think you could get 
> eaccess for other reasons when the file is not readonly?  Maybe it would 
> be better to include the message from the IOError.
> 
> I agree with Alexander that we should perhaps have per-implementation 
> tests.

Well, at most we have 2 implementations on a given platform, and I'm 
considering removing that. Actually implementing the ctypes one was a 
lot more work than the pywin32 one. But now that it is done, it should 
be identical.

(By the way, ctypes will let you cause severe problems. I ran into it 
when I passed a plain "overlapped" object, rather than passing a 
*pointer* to the overlapped object).

> 
> Incidentally: maybe the tests should be named on the pattern of 
> tests/per_*, like per_lock, per_workingtree.  Although the test 
> parameterization mechanism is very cool, I think it may be slightly 
> confusing that/why not all the workingtree implementation tests are in 
> that directory.  (And the names are rather unwieldy.)

Well, those are quite as specific (they need one more word in there, 
like per_workingtree_implementation to be understandable english).

But I do think they are a lot easier to handle, and convey a similar idea.

John
=:->



More information about the bazaar mailing list