From 8d773e27a2411fba05664c1b41fa7dead8b8e8f0 Mon Sep 17 00:00:00 2001 From: kraymer Date: Sun, 8 Apr 2012 10:50:00 +0200 Subject: [PATCH] fix copy(): don't raise OSError because file exists if replace parameter is True --- beets/util/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/beets/util/__init__.py b/beets/util/__init__.py index 4feb38503..aaf8fc6d3 100644 --- a/beets/util/__init__.py +++ b/beets/util/__init__.py @@ -241,7 +241,8 @@ def copy(path, dest, replace=False, pathmod=None): return path = syspath(path) dest = syspath(dest) - _assert_not_exists(dest, pathmod) + if not replace: + _assert_not_exists(dest, pathmod) return shutil.copyfile(path, dest) def move(path, dest, replace=False, pathmod=None):