[win32] selftest of latest bzr.dev with encodings improvements

John Arbash Meinel john at arbash-meinel.com
Sat Jun 10 14:47:07 BST 2006


Alexander Belchenko wrote:
> Alexander Belchenko пишет:
>> John Arbash Meinel пишет:
>>> Alexander Belchenko wrote:
>>>> It's very good that encodings work finally lands into main bzr.dev.
>>>>
>>>> But there is some minor issues with selftest:
>>>>
>>>> 1) Added new test that invoke external editor and simply wait (it
>>>> called
>>>> something like test_delete_commit_message -- I don't remember exactly).
>>>> Because it require of intervention of the user, I think it's prevent to
>>>> run selftest in automatic mode. Furthermore, I run selftest in separate
>>>> console window and then work on other tasks, because selftest took ~30
>>>> min on my machine. So I cannot configure that I need to do something
>>>> interactive. I think this test should be invoked explicitly via
>>>> separate
>>>> command or something like 'bzr selftest --interactive-tests' but not in
>>>> automatic mode when overall selftest suite running.
>>>
>>> We definitely should not run any commands that require interaction in
>>> the default test suite.
>>> I'm not sure why on Linux we don't have this problem, but if you can
>>> give the exact test which is hanging, we will definitely fix that.
>>
>> This test named
>> test_msgeditor.MsgEditorTest.test_deleted_commit_message. And this
>> test every time invoke external editor (that pointed in my $EDITOR
>> environment variable).
> 
> Actually problem in bzrlib.msgeditor._run_editor:
> 
>         try:
>             x = call(edargs + [filename])
>         except OSError, e:
>            # We're searching for an editor, so catch safe errors and
> continue
>            if e.errno in (errno.ENOENT, ):
>                continue
> 
> When mentioned test try to run 'del' command on windows it got error
> errno.ENOENT and it fall down to the next editor. Probably edited file
> was not properly closed before it passed to _run_editor, so it cannot be
> deleted on windows (because windows cannot do unlink for file-in-use).
> 
> -- 
> Alexander

As near as I can tell, you can't actually spawn 'del' on windows. Both
'del' and 'erase' seem to be builtin commands from 'cmd.exe'

The only way I've found to run it, is by calling:

call(['cmd.exe', '/c', 'del', filename])

Now, as it turns out, your _run_editor already is splitting the command
to run on whitespace, so the attached bundle should fix the test. It at
least works for me.

I'm going to be resurrecting my win32 branch to get lots of these things
fixed there, and then merged over. Thanks for being patient and
reporting the bugs Alexander.

John
=:->

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: win32-msg-editor-del.bundle
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20060610/a6124d4e/attachment.diff 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060610/a6124d4e/attachment.pgp 


More information about the bazaar mailing list