Skip to content

Commit 4294b2c

Browse files
committed
Fixes #69
Playing selection was broken.
1 parent 4f9bdab commit 4294b2c

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

CHANGES

+1
Original file line numberDiff line numberDiff line change
@@ -626,3 +626,4 @@ different panes. Tie/untie option added for notes. Broken rhythm
626626
- Fixed: Removed loading of NONEXISTANT_FILE for all players except wxmediaplayer
627627
- Added 'Insert musical symbol' again to the menu again which was removed in 1.3.8.4. Although ABC Assist can insert musical with less hassle, some users really like the old
628628
menu version. For Linux (Gnome) users these menus are still empty but that is caused by Gnome, not EasyABC.
629+
- Fixed: Playing selection gave an error: AttributeError: 'bytes' object has no attribute 'encode' (https://github.com/jwdj/EasyABC/issues/69)

easy_abc.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -487,9 +487,6 @@ def remove_non_note_fragments(abc, exclude_grace_notes=False):
487487

488488
def get_notes_from_abc(abc, exclude_grace_notes=False):
489489
''' returns a list of (start-offset, end-offset, abc-note-text) tuples for ABC notes/rests '''
490-
if not isinstance(abc, str):
491-
abc = abc.encode()
492-
493490
abc = remove_non_note_fragments(abc, exclude_grace_notes)
494491

495492
# find and return ABC notes (including the text ranges)
@@ -4287,7 +4284,7 @@ def GetAbcToPlay(self):
42874284
if tune:
42884285
position, end_position = tune.offset_start, tune.offset_end
42894286
if end_position > position and len(self.selected_note_descs) > 2: ## and False:
4290-
text = self.editor.GetTextRange(position, end_position).encode('utf-8', 'ignore')
4287+
text = self.editor.GetTextRange(position, end_position)
42914288
notes = get_notes_from_abc(text)
42924289
num_header_lines, first_note_line_index = self.get_num_extra_header_lines(tune)
42934290

@@ -4319,7 +4316,6 @@ def GetAbcToPlay(self):
43194316
pieces.append(text[pos:])
43204317
text = ''.join(pieces)
43214318

4322-
text = text.decode('utf-8')
43234319
# for some strange reason the MIDI sequence seems to be cut-off in the end if the last note is short
43244320
# adding a silent extra note seems to fix this
43254321
text = text + os.linesep + '%%MIDI control 7 0' + os.linesep + 'A2'

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
if sys.version_info >= (3,0,0):
88
basestring = str
99

10-
version = '1.3.8.5'
10+
version = '1.3.8.7'
1111
description = "EasyABC"
1212
long_description = "Nils Liberg's EasyABC 1.3.8 (Seymour Shlien)"
1313
url = 'https://sourceforge.net/projects/easyabc/'

0 commit comments

Comments
 (0)