mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +01:00
Merge pull request #4906 from Serene-Arc/poisoned_db_fix
This commit is contained in:
commit
7736ae7634
3 changed files with 5 additions and 3 deletions
|
|
@ -1232,7 +1232,7 @@ def update_items(lib, query, album, move, pretend, fields,
|
||||||
affected_albums = set()
|
affected_albums = set()
|
||||||
for item in items:
|
for item in items:
|
||||||
# Item deleted?
|
# Item deleted?
|
||||||
if not os.path.exists(syspath(item.path)):
|
if not item.path or not os.path.exists(syspath(item.path)):
|
||||||
ui.print_(format(item))
|
ui.print_(format(item))
|
||||||
ui.print_(ui.colorize('text_error', ' deleted'))
|
ui.print_(ui.colorize('text_error', ' deleted'))
|
||||||
if not pretend:
|
if not pretend:
|
||||||
|
|
|
||||||
|
|
@ -452,12 +452,12 @@ def samefile(p1: bytes, p2: bytes) -> bool:
|
||||||
return shutil._samefile(syspath(p1), syspath(p2))
|
return shutil._samefile(syspath(p1), syspath(p2))
|
||||||
|
|
||||||
|
|
||||||
def remove(path: bytes, soft: bool = True):
|
def remove(path: Optional[bytes], soft: bool = True):
|
||||||
"""Remove the file. If `soft`, then no error will be raised if the
|
"""Remove the file. If `soft`, then no error will be raised if the
|
||||||
file does not exist.
|
file does not exist.
|
||||||
"""
|
"""
|
||||||
path = syspath(path)
|
path = syspath(path)
|
||||||
if soft and not os.path.exists(path):
|
if not path or (soft and not os.path.exists(path)):
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
os.remove(path)
|
os.remove(path)
|
||||||
|
|
|
||||||
|
|
@ -233,6 +233,8 @@ Bug fixes:
|
||||||
already. A new option ``--noinherit/-I`` to :ref:`modify <modify-cmd>`
|
already. A new option ``--noinherit/-I`` to :ref:`modify <modify-cmd>`
|
||||||
allows changing this behaviour.
|
allows changing this behaviour.
|
||||||
:bug:`4822`
|
:bug:`4822`
|
||||||
|
* Fix bug where an interrupted import process poisons the database, causing
|
||||||
|
a null path that can't be removed.
|
||||||
|
|
||||||
For packagers:
|
For packagers:
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue