From 352d99cccdbb6b53b051d5642ae64cdf965599d1 Mon Sep 17 00:00:00 2001 From: wordofglass Date: Thu, 24 Aug 2017 14:43:56 +0200 Subject: [PATCH] edit: Do not deepcopy objects, finally fixes the regression from #2659 Deepcopying fails if a database is attached as Model._db since the sqlite connection objects it contains are non-copyable --- beetsplug/edit.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/beetsplug/edit.py b/beetsplug/edit.py index 7b59546cc..5e0559bbf 100644 --- a/beetsplug/edit.py +++ b/beetsplug/edit.py @@ -23,7 +23,6 @@ from beets import ui from beets.dbcore import types from beets.importer import action from beets.ui.commands import _do_query, PromptChoice -from copy import deepcopy import codecs import subprocess import yaml @@ -283,7 +282,7 @@ class EditPlugin(plugins.BeetsPlugin): # Show the changes. # If the objects are not on the DB yet, we need a copy of their # original state for show_model_changes. - objs_old = [deepcopy(obj) if obj.id < 0 else None + objs_old = [obj.copy() if obj.id < 0 else None for obj in objs] self.apply_data(objs, old_data, new_data) changed = False