From 73d101ade524855c6830928cca9a86f6822e995a Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Tue, 9 Feb 2016 23:33:04 +0100 Subject: [PATCH] Properly detect yaml encoding --- patacrep/songbook/__main__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patacrep/songbook/__main__.py b/patacrep/songbook/__main__.py index ce418af2..5ab2c929 100644 --- a/patacrep/songbook/__main__.py +++ b/patacrep/songbook/__main__.py @@ -137,10 +137,10 @@ def main(): try: with patacrep.encoding.open_read(songbook_path) as songbook_file: user_songbook = yaml.load(songbook_file) - if 'encoding' in user_songbook: + if 'encoding' in user_songbook.get('book', []): with patacrep.encoding.open_read( songbook_path, - encoding=user_songbook['encoding'] + encoding=user_songbook['book']['encoding'] ) as songbook_file: user_songbook = yaml.load(songbook_file) except Exception as error: # pylint: disable=broad-except