Manzana-Apple-Music-Downloader icon indicating copy to clipboard operation
Manzana-Apple-Music-Downloader copied to clipboard

"SyntaxError: Non-ASCII character"

Open emresaracoglu opened this issue 1 year ago • 5 comments

Hello,

What is the reason for this error and how can I solve it?

root@serve:/home/Manzana-Apple-Music-Downloader# python manzana.py https://music.apple.com/lk/music-video/taki-taki-feat-selena-gomez-ozuna-cardi-b/1438473545
  File "manzana.py", line 21
SyntaxError: Non-ASCII character '\xe2' in file manzana.py on line 22, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
root@serve:/home/Manzana-Apple-Music-Downloader#

on Debian 10 server.

Thank you!

emresaracoglu avatar Dec 10 '23 13:12 emresaracoglu

@emresaracoglu Try adding # -*- coding: utf-8 -*- to top of the first line in manzana.py.

dropcreations avatar Dec 17 '23 06:12 dropcreations

I'm getting the same error message, I wrote the following:

python # -- coding: utf-8 -- manzana.py https://music.apple.com/lk/music-video/taki-taki-feat-selena-gomez-ozuna-cardi-b/1438473545

Is this correct?

Also, I'm doing this on a Mac. is Mac compatible via Terminal?

toughguystudios avatar Dec 26 '23 02:12 toughguystudios

@toughguystudios I never used this program before, but I wrote a lot of python scripts. You will need to open the manzana.py script with a text editor (TEXT, not word, not textedit, use Visual Code for example) and add the line to the TOP of the manzana.py file. So inside it. UTF-8 is needed to process characters that are non-ASCII, like accents for example.

Lexstok avatar Dec 26 '23 22:12 Lexstok

@dropcreations Thank you for your help.

emresaracoglu avatar Jan 14 '24 13:01 emresaracoglu

I didn't understand, what verbatim needs to be added to the top line of the file?

toughguystudios avatar Jan 14 '24 13:01 toughguystudios