Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emdash in an article produces a crash #169

Open
edlerd opened this issue Jul 14, 2023 · 0 comments
Open

Emdash in an article produces a crash #169

edlerd opened this issue Jul 14, 2023 · 0 comments

Comments

@edlerd
Copy link
Contributor

edlerd commented Jul 14, 2023

An emdash \u2013 crashes the parsing process and the API returns an error.

See trace below for details. The requested article contained this bit of text: <!-- Todo uncomment on release --> where I suspect the -- was converted to an emdash

2023-07-14 12:30:35.330Z WARNING flask.app "Invalid level used: <!–TODO: Uncomment next release" service=charmed-kubeflow.io pid=9 request_id=123
2023-07-14 12:30:35.330Z WARNING flask.app "Could not parse redirect map for " service=charmed-kubeflow.io pid=9 request_id=123
2023-07-14 12:30:35.331Z INFO talisker.wsgi "GET /docs" method=GET path=/docs status=200 view=canonicalwebteam.discourse.app.main_docs.document_view duration_ms=365.682 ip=10.131.33.101 proto=HTTP/1.1 length=27888 referrer=https://charmed-kubeflow.io/ forwarded=1.2.3.4 ua="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" http_count=1 http_time_ms=250.036 service=charmed-kubeflow.io pid=9 request_id=123
2023-07-14 12:30:35.331Z ERROR gunicorn.error "Error handling request /docs" service=charmed-kubeflow.io pid=9
Traceback (most recent call last):
  File "/root/.local/lib/python3.10/site-packages/gunicorn/workers/base_async.py", line 55, in handle
    self.handle_request(listener_name, req, client, addr)
  File "/root/.local/lib/python3.10/site-packages/gunicorn/workers/ggevent.py", line 127, in handle_request
    super().handle_request(listener_name, req, sock, addr)
  File "/root/.local/lib/python3.10/site-packages/gunicorn/workers/base_async.py", line 116, in handle_request
    resp.write(item)
  File "/root/.local/lib/python3.10/site-packages/gunicorn/http/wsgi.py", line 326, in write
    self.send_headers()
  File "/root/.local/lib/python3.10/site-packages/gunicorn/http/wsgi.py", line 322, in send_headers
    util.write(self.sock, util.to_bytestring(header_str, "latin-1"))
  File "/root/.local/lib/python3.10/site-packages/gunicorn/util.py", line 565, in to_bytestring
    return value.encode(encoding)
UnicodeEncodeError: 'latin-1' codec can't encode character '\u2013' in position 200: ordinal not in range(256)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant