From 737b85aee524ecbbed85248c5650edb972569cd2 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Fri, 10 Jun 2016 12:37:33 +0200 Subject: [PATCH 1/4] Provoque bug, when trailing newline is missing --- test/test_song/newline.csg.source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_song/newline.csg.source b/test/test_song/newline.csg.source index 03095b88..492a991e 100644 --- a/test/test_song/newline.csg.source +++ b/test/test_song/newline.csg.source @@ -29,4 +29,4 @@ New lines can also {newline} Be surrounded by spaces -New lines cannot {newline} appear in the middle of a line +New lines cannot {newline} appear in the middle of a line \ No newline at end of file From 594ab09510f96042cfd794c38e0bba2a306e6310 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Fri, 10 Jun 2016 12:41:25 +0200 Subject: [PATCH 2/4] Quick fix to the missing trailing newline bug --- patacrep/songs/chordpro/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patacrep/songs/chordpro/__init__.py b/patacrep/songs/chordpro/__init__.py index 8464131f..9d10d7b4 100644 --- a/patacrep/songs/chordpro/__init__.py +++ b/patacrep/songs/chordpro/__init__.py @@ -42,7 +42,7 @@ class ChordproSong(Song): def _parse(self): """Parse content, and return the dictionary of song data.""" with encoding.open_read(self.fullpath, encoding=self.encoding) as song: - song = parse_song(song.read(), self.fullpath) + song = parse_song(song.read().strip()+"\n", self.fullpath) self.authors = song.authors self.titles = song.titles self.lang = song.get_data_argument('language', self.lang) From 218820b9919fd6b9f90cbcd21680316e2fac8027 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Fri, 10 Jun 2016 12:41:47 +0200 Subject: [PATCH 3/4] Fix the test cases --- test/test_patatools/test_convert_failure/song.csg | 2 +- test/test_song/00.tsg | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/test/test_patatools/test_convert_failure/song.csg b/test/test_patatools/test_convert_failure/song.csg index cb763ba7..ed3061d6 100644 --- a/test/test_patatools/test_convert_failure/song.csg +++ b/test/test_patatools/test_convert_failure/song.csg @@ -119,4 +119,4 @@ -\endsong \ No newline at end of file +\endsong{ \ No newline at end of file diff --git a/test/test_song/00.tsg b/test/test_song/00.tsg index bd99a922..c2d0cc18 100644 --- a/test/test_song/00.tsg +++ b/test/test_song/00.tsg @@ -7,4 +7,6 @@ + + \endsong From 28d9ab1bd2a1202cfa382764d590426fb7d48503 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Fri, 10 Jun 2016 12:49:30 +0200 Subject: [PATCH 4/4] update news --- NEWS.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/NEWS.md b/NEWS.md index a5396036..b7ecbd22 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +# patacrep {current_master} + +* Bugfixes + * Chordpro files don't need to end with a trailing line [#223](https://github.com/patacrep/patacrep/pull/223) + # patacrep 5.0.0 * Songbook file