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: