bzr explorer or tortoisebzr causes Python test suite failures on Windows

Bug #559242 reported by Barry Warsaw
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar Explorer
Invalid
Undecided
Unassigned
TortoiseBZR
New
Undecided
Unassigned

Bug Description

Okay, this is a weird bug. I have a checkout of lp:python/py3k on Windows which I did with bzr explorer and tortoise bazaar. bzr 2.1.1 tbazaar 0.5.4 on Windows 7. The Python test suite creates some temporary files in the current directory (i.e. top of the tree) and then after certain tests os.remove()s them. These removes fail with errno=5 which is likely caused by tortoise keeping the files open. As you know, Windows unlike Posix, is none-to-happy about removing files which are open.

This upstream bug report describes a similar problem with tortoise svn:

http://bugs.python.org/issue7443

Note that removing the .bzr directory solves this problem, presumably by disabling whatever filesystem actions tbzr is doing. The only fix I can think of would be a button to temporarily turn off tbzr actions that could hold open such fleeting files.

Revision history for this message
methane (songofacandy) wrote :

OK, I'll add "Disable TBZR temporary" to task tray menu.
But, why bzr prevents file deletion?

I think bzr should use "FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE" when
opening file while "bzr status".

Revision history for this message
methane (songofacandy) wrote :

Python's os.open doesn't support FILE_SHARE_DELETE.
``_sopen_s`` supports the flag but ``open`` doesn't. And os.open use ``open``.

So, to use FILE_SHARE_DELETE, bzr should use CreateFileW API through ctypes or pywin32,
or implement open_s as a extension module.

Revision history for this message
Ian Clatworthy (ian-clatworthy) wrote :

I don't think explorer is involved here.

Changed in bzr-explorer:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.