Sagi
Sagi

Reputation: 329

Flaskr UnicodeDecodeError

I'm a beginner at Python. I want to learn a web framework, and I chose Flask. I have run through the quickstart. After that, I kept going on the Tutorial. But, I was stuck.

After I cloned this project on github https://github.com/zhangjingqiang/flaskr

I ran python flaskr.py and opened my web browser to check if it's working. I got this error message:

Exception happened during processing of request from ('127.0.0.1', 60970)
Traceback (most recent call last):
  File "/usr/lib/python2.7/SocketServer.py", line 295, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 321, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.7/SocketServer.py", line 649, in __init__
    self.handle()
  File "/home/jsying/桌面/flaskr/venv/local/lib/python2.7/site-packages/werkzeug/serving.py", line 182, in handle
    rv = BaseHTTPRequestHandler.handle(self)
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
    self.handle_one_request()
  File "/home/jsying/桌面/flaskr/venv/local/lib/python2.7/site-packages/werkzeug/serving.py", line 217, in handle_one_request
    return self.run_wsgi()
  File "/home/jsying/桌面/flaskr/venv/local/lib/python2.7/site-packages/werkzeug/serving.py", line 176, in run_wsgi
    traceback.plaintext)
  File "/home/jsying/桌面/flaskr/venv/local/lib/python2.7/site-packages/werkzeug/utils.py", line 77, in __get__
    value = self.func(obj)
  File "/home/jsying/桌面/flaskr/venv/local/lib/python2.7/site-packages/werkzeug/debug/tbtools.py", line 332, in plaintext
    return u'\n'.join(self.generate_plaintext_traceback())
  File "/home/jsying/桌面/flaskr/venv/local/lib/python2.7/site-packages/werkzeug/debug/tbtools.py", line 326, in generate_plaintext_traceback
    frame.function_name
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 13: ordinal not in range(128)   

I have no idea how to fix it. Can somebody help me? Thanks.

Upvotes: 1

Views: 403

Answers (2)

chejianchao
chejianchao

Reputation: 21

Modify your path without "桌面".

Upvotes: 0

eandersson
eandersson

Reputation: 26352

My guess would be that there is an issue because of the special characters in the path, 桌面. Try moving the folder to

/home/jsying/flaskr/

Upvotes: 1

Related Questions