Modify ↓
Ticket #397 (closed defect: fixed)
Logging test fails on windows because a handle is left open
| Reported by: | KyleMac | Owned by: | andrew |
|---|---|---|---|
| Priority: | major | Milestone: | 0.7 |
| Component: | commands | Version: | 0.7-rc1 |
| Keywords: | Cc: |
Description
Line 36 in test_db_execute_logging_validfile() opens the file to check that it is writable but it is not closed before os.remove() on line 44. This raises a WindowsError?.
Attachments
Change History
comment:1 Changed 3 years ago by andrew
- Status changed from new to closed
- Resolution set to fixed
- Milestone set to 0.7
comment:2 Changed 3 years ago by KyleMac
The close_logger() stuff seems to work fine, it's line 36 in the test that is actually holding it open.
Line 36 should be something like "temp = open(whatever)" and then before 44 do "temp.close()".
comment:3 Changed 3 years ago by andrew
Right you are. Fixed in [61cf8cec5421].
Note: See
TracTickets for help on using
tickets.

How annoying, I wrote some code to close the logging handlers before the os.remove specifically for this reason.
Since it's a temporary file (i.e. in your Temp directory) that's used for logging, I've made the removal optional in [dd202dda7559].