Page MenuHomePhabricator

fix the bug of opening the file with the bytes can't be decoded to 'utf-8'
Needs ReviewPublic

Authored by yogurfrul on Jun 12 2017, 1:36 AM.



fix the bug as blow:

ip- - [28/May/2017 17:16:23] "GET /TestDraft.cpp HTTP/1.1" 200 -

Exception happened during processing of request from ('ip', 56600)
Traceback (most recent call last):

File "/usr/lib/python3.4/", line 305, in _handle_request_noblock
  self.process_request(request, client_address)
File "/usr/lib/python3.4/", line 331, in process_request
  self.finish_request(request, client_address)
File "/usr/lib/python3.4/", line 344, in finish_request
  self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.4/", line 673, in __init__
File "/usr/lib/python3.4/http/", line 398, in handle
File "/usr/lib/python3.4/http/", line 386, in handle_one_request
File "/home/workspace/", line 165, in do_GET
  for line_no, line in enumerate(f, start=1)])
File "/home/workspace/", line 162, in <listcomp>
  ["<span class='{cls}'>{line}&nbsp;</span>".format(
File "/usr/lib/python3.4/", line 319, in decode
  (result, consumed) = self._buffer_decode(data, self.errors, final)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb5 in position 4164: invalid start byte

Diff Detail


Event Timeline

yogurfrul created this revision.Jun 12 2017, 1:36 AM
yogurfrul edited the summary of this revision. (Show Details)
yogurfrul updated this revision to Diff 102160.Jun 12 2017, 1:53 AM

update the path of changed file

m.ostapenko added a project: Restricted Project.Jun 26 2017, 5:54 AM
m.ostapenko added a reviewer: aizatsky.
m.ostapenko added a subscriber: llvm-commits.

any reviewer here? My commit has been hold on 1 year!!!