Commit 4ca4e59
committed
fix: close file properly in indexer_dbm.py:save_index()
Fix this error found in debug logs of gentoo packaging of round 2.2.0.
/roundup/backends/indexer_dbm.py:253: ResourceWarning: unclosed file
<_io.BufferedWriter name='test-index/indexes/index.db-'>
open(self.indexdb+'-', 'wb').write(zlib.compress(marshal.dumps(dbfil)))
Also added test that calls save_index(), reloads the index and tests
that the original item. I am not sure how Gentoo hit
this But they were missing a number of backends. So it's possible that
indexer_dbm.py is not getting fully tested depending on what is
installed on the system. Codecov from CI didnt show
indexer_dbm.py:save_index() being covered.1 parent 20d498c commit 4ca4e59
File tree
3 files changed
+28
-1
lines changed- roundup/backends
- test
3 files changed
+28
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
254 | 256 | | |
255 | 257 | | |
256 | 258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
107 | 131 | | |
108 | 132 | | |
109 | 133 | | |
| |||
0 commit comments