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

"SyntaxError: Non-ASCII character" #24

Open
emresaracoglu opened this issue Dec 10, 2023 · 5 comments
Open

"SyntaxError: Non-ASCII character" #24

emresaracoglu opened this issue Dec 10, 2023 · 5 comments

Comments

@emresaracoglu
Copy link

emresaracoglu commented Dec 10, 2023

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!

@dropcreations
Copy link
Owner

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

@toughguystudios
Copy link

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?

@Lexstok
Copy link

Lexstok commented Dec 26, 2023

@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.

@emresaracoglu
Copy link
Author

@dropcreations Thank you for your help.

@toughguystudios
Copy link

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

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

4 participants