CQU-AI / cqu-kb

第三方重庆大学课表日历生成工具
GNU Affero General Public License v3.0
7 stars 2 forks source link

A wired character `Ò»` caused the program to crash #6

Closed 0xSeanll closed 4 years ago

0xSeanll commented 4 years ago
Traceback (most recent call last):
  File "/home/mc/.local/lib/python3.6/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/mc/.local/lib/python3.6/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/mc/.local/lib/python3.6/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/mc/.local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/mc/.local/lib/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/mc/.local/lib/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "./app.py", line 14, in get_ical
    server_main(username, password, path)
  File "/home/mc/.local/lib/python3.6/site-packages/cqu_kb/__main__.py", line 11, in server_main
    main(username, password, path)
  File "/home/mc/.local/lib/python3.6/site-packages/cqu_kb/__main__.py", line 32, in main
    data=get_payload(student)
  File "/home/mc/.local/lib/python3.6/site-packages/cqu_kb/core.py", line 118, in get_cal
    day = chinese_to_numbers[course['time'].split('[')[0]]
KeyError: 'Ò»'

This only appears in some special cases. The character may come from the trash website.

loopyme commented 4 years ago

Btw, we should consider adding a error traceback on the web page