Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Program breaks on files with apostrophe #26

Closed
wcrasta opened this issue Dec 30, 2016 · 2 comments
Closed

Program breaks on files with apostrophe #26

wcrasta opened this issue Dec 30, 2016 · 2 comments

Comments

@wcrasta
Copy link

wcrasta commented Dec 30, 2016

Hi,

I'm running Windows 10 64-Bit. When I run MusicRepair on my directory, everything works fine until I get to a file with an apostrophe such as "Don't Let Me Down.mp3". When the program encounters this file, I get the following error.

Traceback (most recent call last): File "C:\Program Files\Python35\Scripts\musicrepair-script.py", line 11, in <module> load_entry_point('musicrepair==5.9.2', 'console_scripts', 'musicrepair')() File "c:\program files\python35\lib\site-packages\musicrepair\command_line.py", line 415, in main fix_music(arg_rename_format, norename=arg_norename, recursive=arg_recursive) File "c:\program files\python35\lib\site-packages\musicrepair\command_line.py", line 334, in fix_music add_details(file_path, song_name, artist, album, lyrics) File "c:\program files\python35\lib\site-packages\musicrepair\command_line.py", line 264, in add_details log.log_indented("[*] Title: %s" % title) File "c:\program files\python35\lib\site-packages\musicrepair\log.py", line 15, in log_indented log(' %s' % text, newline=newline, trailing_newline=trailing_newline) File "c:\program files\python35\lib\site-packages\musicrepair\log.py", line 11, in log print('%s%s%s' % (newline_char, text, trailing_newline_char)) File "c:\program files\python35\lib\site-packages\colorama\ansitowin32.py", line 40, in write self.__convertor.write(text) File "c:\program files\python35\lib\site-packages\colorama\ansitowin32.py", line 141, in write self.write_and_convert(text) File "c:\program files\python35\lib\site-packages\colorama\ansitowin32.py", line 169, in write_and_convert self.write_plain_text(text, cursor, len(text)) File "c:\program files\python35\lib\site-packages\colorama\ansitowin32.py", line 174, in write_plain_text self.wrapped.write(text[start:end]) File "c:\program files\python35\lib\encodings\cp437.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_map)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\xb4' in position 21: character maps to <undefined>

@kalbhor
Copy link
Owner

kalbhor commented Dec 30, 2016

Seems like colorama (The module I use to print in pretty colours) fails to map character to the windows console.
Try running this on your terminal:
export PYTHONIOENCODING=utf8

@wcrasta
Copy link
Author

wcrasta commented Jan 1, 2017

Quick comment, with Windows, the appropriate command is SET PYTHONIOENCODING=utf8. It seems to work, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants