From 392f9861e047927e5118b2cda29acb9d154c42f0 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sun, 23 Dec 2012 18:06:55 -0800 Subject: [PATCH] allow the import log path to be None --- beets/ui/commands.py | 5 ++--- beets/util/confit.py | 4 ++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/beets/ui/commands.py b/beets/ui/commands.py index 25edd20ca..5167ec746 100644 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -622,9 +622,8 @@ def import_files(lib, paths, query): raise ui.UserError("can't be both quiet and timid") # Open the log. - logpath = config['import']['log'].as_filename() - if logpath: - logpath = normpath(logpath) + if config['import']['log'].get() is not None: + logpath = config['import']['log'].as_filename() try: logfile = open(syspath(logpath), 'a') except IOError: diff --git a/beets/util/confit.py b/beets/util/confit.py index 01191d8ce..8db60bd62 100644 --- a/beets/util/confit.py +++ b/beets/util/confit.py @@ -319,6 +319,10 @@ class ConfigView(object): is relative to the current working directory. """ path, source = self.first() + if not isinstance(path, BASESTRING): + raise ConfigTypeError('{0} must be a filename, not {1}'.format( + self.name, type(path).__name__ + )) path = os.path.expanduser(STRING(path)) if source.default: