You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's some cases where our console output can raise exceptions, because we're not currently escaping anything that might be interpreted by rich as a markup template tag.
Will has already done a little work on this here #1866 but I expect that it needs updating, and probably isn't complete.
Eg...
$ httpx https://cataas.com/cat
HTTP/1.1 200 OK
Server: nginx/1.12.2
Date: Thu, 27 Jan 2022 11:19:17 GMT
Content-Type: image/jpeg
Content-Length: 40849
Connection: keep-alive
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: X-Requested-With, Content-Type, Accept, Origin, Authorization
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Cache-Control: public, max-age=30
ETag: 1643256053593
Traceback (most recent call last):
File "venv/bin/httpx", line 11, in<module>
load_entry_point('httpx', 'console_scripts', 'httpx')()
File "/Users/tomchristie/GitHub/encode/httpx/venv/lib/python3.7/site-packages/click/core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "/Users/tomchristie/GitHub/encode/httpx/venv/lib/python3.7/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/Users/tomchristie/GitHub/encode/httpx/venv/lib/python3.7/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/tomchristie/GitHub/encode/httpx/venv/lib/python3.7/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/Users/tomchristie/GitHub/encode/httpx/httpx/_main.py", line 486, in main
print_response(response)
File "/Users/tomchristie/GitHub/encode/httpx/httpx/_main.py", line 176, in print_response
console.print(response.text)
File "/Users/tomchristie/GitHub/encode/httpx/venv/lib/python3.7/site-packages/rich/console.py", line 1602, in print
highlight=highlight,
File "/Users/tomchristie/GitHub/encode/httpx/venv/lib/python3.7/site-packages/rich/console.py", line 1460, in _collect_renderables
renderable, emoji=emoji, markup=markup, highlighter=_highlighter
File "/Users/tomchristie/GitHub/encode/httpx/venv/lib/python3.7/site-packages/rich/console.py", line 1355, in render_str
emoji_variant=self._emoji_variant,
File "/Users/tomchristie/GitHub/encode/httpx/venv/lib/python3.7/site-packages/rich/markup.py", line 161, in render
) from None
rich.errors.MarkupError: closing tag '[/�$B����c}Nʌ��W�a�����}O��W��4Q;!�����0]' at position 3761 doesn't match any open tag
(Note that the above URL happens to return a random cat image, so you'll only sometimes see this error.)
The text was updated successfully, but these errors were encountered:
There's some cases where our console output can raise exceptions, because we're not currently escaping anything that might be interpreted by
rich
as a markup template tag.Will has already done a little work on this here #1866 but I expect that it needs updating, and probably isn't complete.
Eg...
(Note that the above URL happens to return a random cat image, so you'll only sometimes see this error.)
The text was updated successfully, but these errors were encountered: