From 17dca0695202ed595ecf5b26b155f43d62438fff Mon Sep 17 00:00:00 2001 From: Saman Date: Tue, 23 Jun 2026 19:09:26 +0330 Subject: [PATCH] Copy Bugfix --- music_mate/basic_converter.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/music_mate/basic_converter.py b/music_mate/basic_converter.py index f6762ee..358dfaf 100644 --- a/music_mate/basic_converter.py +++ b/music_mate/basic_converter.py @@ -10,7 +10,7 @@ from os.path import splitext, basename, join, dirname from os import makedirs from lilypond import executable from tempfile import TemporaryDirectory -from shutil import copy2 +from shutil import copy2, copy from platform import system lilypond_path=str(executable()) if system()=="Windows" and not lilypond_path.lower().endswith('.exe'): @@ -69,5 +69,9 @@ def media_to_notes(input_path,output_path,lilypond_path=lilypond_path): #Making The PDF run([lilypond_path,"-I",tmp,"-o",join(tmp,file_name),join(tmp,file_name+'.ly')],check=True) - copy2(join(tmp,file_name+'.pdf'),output_path) + try: + copy2(join(tmp,file_name+'.pdf'),output_path) + except: + copy(join(tmp,file_name+'.pdf'),output_path) + print(f"Notes PDF saved to {output_path}.")