Windows exceptions not handled when locking working tree
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
Undecided
|
Martin Packman | ||
Python for Windows Extensions |
Unknown
|
Unknown
|
Bug Description
In attempting to fix a bug reported on BzrExplorer (Bug 568728) I came across an issue with exception handling across different platforms.
The bug exhibited itself when a working tree displayed in Explorer was renamed or deleted using the OS and the repository tab in Explorer was refreshed.
On Windows an unhandled exception was displayed for a pywintypes.error with a stack dump for "File "bzrlib\lock.pyo", line 352, in _open error: (3, 'CreateFileW', 'The system cannot find the path specified.')" caused by qbzr attempting to obtain a lock on a working tree that no longer exists.
Review comments on a qbzr patch to fix the problem indicated that on UBUNTU a 'friendly' dialog is displayed rather than an unhandled exception. This is managed by qbzr and relies on the return from bzrlib.
The bug in bzr is that it does not handle the Windows specific errors in away that allows them to be treated generically downstream.
Related branches
- Andrew Bennetts: Approve
- Robert Collins (community): Needs Fixing
- Alexander Belchenko: Approve
-
Diff: 59 lines (+18/-2)3 files modifiedbzrlib/tests/features.py (+1/-0)
bzrlib/tests/test_trace.py (+14/-1)
bzrlib/trace.py (+3/-1)
Changed in bzr: | |
milestone: | none → 2.2b3 |
Perhaps pywintypes.error should be treated the same as OSError in report_exception?