Upload error - UnicodeEncodeError: 'ascii' codec can't encode character '\xf2' in position 68

Hi

Hope this is the right section of the forum for this.

I had an error for a user today who tried to upload a file with the following filename:

  • JLR Interview Series Maria Chiara Argirò 27 October 2020.mp3

The upload failed so I looked in /var/log/airtime/airtime_analyzer.log

There was this error:

UnicodeEncodeError: 'ascii' codec can't encode character '\xf2' in position 68: ordinal not in range(128)
2020-11-04 10:23:07,895 [message_listener] [ERROR]  Analyzer pipeline exception: 'ascii' codec can't encode character '\xf2' in position 68: ordinal not in range(128)
2020-11-04 10:23:07,950 [status_reporter] [INFO ]  HTTP request sent successfully.
2020-11-04 13:22:14,099 [message_listener] [INFO ]   - Received 'b'{"tmp_file_path":"\\/srv\\/airtime\\/stor\\/organize\\/JLR Interview Series Maria Chiara Argir\\u00f2 27 October 2020.mp3","storage_backend":"file","import_directory":"\\/srv\\/airtime\\/stor\\/\\/imported\\/3","original_filename":"JLR Interview Series Maria Chiara Argir\\u00f2 27 October 2020.mp3","callback_url":"http:\\/\\/example.com\\/\\/rest\\/media\\/17640","api_key":"3H2B2CEXDGYNQRRUNXD1","file_prefix":""}'' on routing_key ''
2020-11-04 13:22:14,100 [analyzer_pipeline] [ERROR]  'ascii' codec can't encode character '\xf2' in position 66: ordinal not in range(128

So, I changed the filename to remove the accented character (ò), as follows:

  • JLR_Interview_Series_Maria_Chiara_Argiro_271020.mp3

The file upload still failed as follows:

UnicodeEncodeError: 'ascii' codec can't encode character '\xf2' in position 47: ordinal not in range(128)
2020-11-04 13:25:46,094 [message_listener] [ERROR]  Analyzer pipeline exception: 'ascii' codec can't encode character '\xf2' in position 47: ordinal not in range(128)
2020-11-04 13:25:46,160 [status_reporter] [INFO ]  HTTP request sent successfully.
2020-11-04 13:29:38,252 [message_listener] [INFO ]   - Received 'b'{"tmp_file_path":"\\/srv\\/airtime\\/stor\\/organize\\/JLR_Interview_Series_Maria_Chiara_Argiro_271020.mp3","storage_backend":"file","import_directory":"\\/srv\\/airtime\\/stor\\/\\/imported\\/3","original_filename":"JLR_Interview_Series_Maria_Chiara_Argiro_271020.mp3","callback_url":"http:\\/\\/example.com\\/\\/rest\\/media\\/17642","api_key":"3H2B2CEXDGYNQRRUNXD1","file_prefix":""}'' on routing_key ''
2020-11-04 13:29:38,480 [cuepoint_analyzer] [WARNI]  ['silan', '-b', '-F', '0.99', '-f', 'JSON', '-t', '1.0', '/srv/airtime/stor/organize/JLR_Interview_Series_Maria_Chiara_Argiro_271020.mp3'] b'*** stack smashing detected ***: <unknown> terminated\n' -6
2020-11-04 13:29:38,481 [replaygain_analyzer] [WARNI]  __init__() got an unexpected keyword argument 'text'
2020-11-04 13:29:38,624 [analyzer_pipeline] [ERROR]  'ascii' codec can't encode character '\xf2' in position 47: ordinal not in range(128)

I played the file using Winamp and saw that the metadata still contained the accented character so I corrected that and eventually uploaded the file successfully.

Question: is it on the development schedule for LT to support accented characters or is there a current adjustment that can be made to support accented characters? I doubt that I’m the first person to experience this issue and music files, artist names, and so on will frequently contain accented characters.

Aside from that, I thank the developers for the hard work in improving LT.

ITCrowd

There should definitely be work done in this area. Do you know if there is a GitHub issue tracking this already?