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

Crash When Deleting File with Cyrillic characters or emojis in the file name. #86

Closed
netcaretx opened this issue Sep 2, 2023 · 2 comments
Labels
issue / bug Something is not working

Comments

@netcaretx
Copy link

Goal was to delete downloaded Youtube video after watching them, but many have unusual characters in the file name and always generate a crash while trying to delete them.

Example:
:[DELETE] - Movie - 8H Rain Inside Car 🌧️ Harry Potter ASMR Ambience 🌧️ Flying Car with Harry & R on - Back to Hogwarts - Unknown - Played <1 day ago - Play Count: 1 - Created <1 day ago - Favorite: False - WhiteTag: False - BlackTag: False - Whitelisted: False - Blacklisted: True - MovieID: 846917
Traceback (most recent call last):
File "C:\Users\Richard\Desktop\MUMC-MUMC\mumc.py", line 8595, in
movie_dict,movie_found=get_media_items('movie',config_dict,movie_dict,user_key)
File "C:\Users\Richard\Desktop\MUMC-MUMC\mumc.py", line 6037, in get_media_items
build_print_media_item_details(item,mediaType,output_state_dict)
File "C:\Users\Richard\Desktop\MUMC-MUMC\mumc.py", line 5043, in build_print_media_item_details
print_byType(':
[DELETE] - ' + item_output_details,print_media_delete_info)
File "C:\Users\Richard\Desktop\MUMC-MUMC\mumc.py", line 107, in print_byType
appendTo_DEBUG_log(string_to_print,1)
File "C:\Users\Richard\Desktop\MUMC-MUMC\mumc.py", line 99, in appendTo_DEBUG_log
save_file(str(string_to_save),GLOBAL_DEBUG_FILE_NAME,"a")
File "C:\Users\Richard\Desktop\MUMC-MUMC\mumc.py", line 1476, in save_file
f.write(dataInput)
File "C:\Users\Richard\AppData\Local\Programs\Python\Python310\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 40-41: character maps to

@terrelsa13 terrelsa13 added the issue / bug Something is not working label Sep 10, 2023
@terrelsa13
Copy link
Owner

@netcaretx Looks like you have debug on and it is crashing when it is trying to write Cyrillic and emojis to the debug log. If debug is not needed please turn it off.

Python uses unicode by default. So it should be able to handle Cyrillic and emjoi without any issues. As you can see in your post the "cloudy-rainy" emoji printed.

@terrelsa13
Copy link
Owner

This is resolved with v5.2.0 on the beta branch.

When printing to the debug log, if an emjoi is found it is remove and replaced with ***emoji_removed***

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue / bug Something is not working
Projects
None yet
Development

No branches or pull requests

2 participants