google-research / url-nlp

195 stars 23 forks source link

fun-langid: Encoding error when running with Python 3 #7

Open mihnita opened 1 year ago

mihnita commented 1 year ago

Uncommented the last 2 lines (langid = ... and print)

Executed this from command prompt, on macos:

python3 fun_langid.py

Error:

SyntaxError: Non-UTF-8 code starting with '\xd1' in file .../fun-langid/fun_langid.py on line 76, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
icaswell commented 1 year ago

Ah oops it was working on my gLinux, but you're right it doesn't work on MacOS! Good catch.

I just tried running it on mac, and it worked to add # coding: utf8 to the top of the file. Does this work for you as well?

icaswell commented 1 year ago

Just submitted https://github.com/google-research/url-nlp/commit/6ce0aec9c20aa2369ffbe6aede2fd1006143f693 that should fix this