0

I'm new in programming and today I started learning the flask on python 3.7. When I started the following code:

from flask import Flask

app = Flask(__name__)


@app.route('/')
def hello() -> str:
    return 'Hello World!'


app.run()

caused an error:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd1 in position 0: invalid continuation byte

How to fix it?

Anzujaami
  • 1
  • 3
  • Please refer to this answer [here](https://stackoverflow.com/a/5552623/8020385). – Christopher Nuccio Sep 17 '18 at 14:13
  • Welcome to Stack Overflow! You should read [ask] to find some ways to ask well received questions. Here you are lacking the full stacktrace of the error, which is necessary to fully understand what happens, and you question could be close for that reason. In addition, you are supposed to do some research before asking here, and a google search for *flask unicodedecodeerror 'utf8' codec can't decode byte* gave [this other question](https://stackoverflow.com/q/46510470/3545273). While it has been closed for not meeting SO rules, an answer suggest that is can be caused... – Serge Ballesta Sep 17 '18 at 14:43
  • ... by non ASCII characters in the path of the application. So you should: 1/ read the linked question and see whether your problem is caused by the pathname 2/ add the full stacktrace and say the result of the first investigation. Good luck and see you later with better questions... – Serge Ballesta Sep 17 '18 at 14:46

0 Answers0