Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Iskander Ismagilov](https://uploads.teamtreehouse.com/production/profile-photos/4817582/micro_IMG_9263.jpg)
Iskander Ismagilov
13,298 Points'utf-8' codec can't decode byte 0xcf [SOLVED]
Hi, everybody! I have a problem, when I try to launch this code locally, using PowerShell on Windows 7:
from flask import Flask
app = Flask(__name__)
app.route('/')
app.route('/<name>')
def index(name="Treehouse"):
return "Hello from {}".format(name)
app.run(debug=True, port=8000, host='127.0.0.1') # I changed host, so I can get to the page using my browser.
and when I run this script, it throws an exception:
File "c:\python35\Lib\socket.py", line 658, in getfqdn
hostname, aliases, ipaddrs = gethostbyaddr(name)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcf in position 2: invalid continuation byte
Is it because of some problem with utf to convert some symbols in uncode?
2 Answers
![Iskander Ismagilov](https://uploads.teamtreehouse.com/production/profile-photos/4817582/micro_IMG_9263.jpg)
Iskander Ismagilov
13,298 PointsThank's Chris,
I got it, I found this document: http://bugs.python.org/issue9377. So the prooblem was because of non-ASCII symbols in the host name of my computer, so after I figure out that the name of my computer and the host name of my computer are the same, I just changed it.
![Chris Freeman](https://uploads.teamtreehouse.com/production/profile-photos/1153532/micro_image.jpg)
Chris Freeman
Treehouse Moderator 68,425 PointsNot sure about the byte decode issue, but there is another issue with your code.
The app.route
decorators need to be prefixed with an at sign @
@app.route('/')
@app.route('/<name>')
def index(name="Treehouse"):
return "Hello from {}".format(name)
Post back if that's not the issue.
![Chris Freeman](https://uploads.teamtreehouse.com/production/profile-photos/1153532/micro_image.jpg)
Chris Freeman
Treehouse Moderator 68,425 PointsFantastic! I would not have figured it out with my current environment
Chris Freeman
Treehouse Moderator 68,425 PointsChris Freeman
Treehouse Moderator 68,425 PointsMoved to answer. Mark Best Answer.