From 6de2b0b5284eb3c27583e4d8dc9017675a023b28 Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrimali Date: Wed, 7 Sep 2022 18:35:58 +0530 Subject: [PATCH] Docs [Fix]: use bytes instead of strings while writing (#14505) * Fix doc examples: use bytes instead of strings while writing * Add a note (comment) * nit * Update any_server.rst * Update docs/source-app/workflows/add_server/any_server.rst * Update docs/source-app/workflows/add_server/any_server.rst * Update docs/source-app/workflows/add_server/any_server.rst * Apply suggestions from code review Co-authored-by: Laverne Henderson Co-authored-by: Ethan Harris Co-authored-by: thomas chaton --- docs/source-app/workflows/add_server/any_server.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/source-app/workflows/add_server/any_server.rst b/docs/source-app/workflows/add_server/any_server.rst index 398951276c..2e26b880e8 100644 --- a/docs/source-app/workflows/add_server/any_server.rst +++ b/docs/source-app/workflows/add_server/any_server.rst @@ -31,7 +31,8 @@ Any server that listens on a port, can be enabled via a work. For example, here' def do_GET(self): self.send_response(HTTPStatus.OK) self.end_headers() - html = "

Hello lit world " + # Data must be passed as bytes to the `self.wfile.write` call + html = b"

Hello lit world " self.wfile.write(html) @@ -52,7 +53,8 @@ To enable the server inside the component, start the server in the run method an def do_GET(self): self.send_response(HTTPStatus.OK) self.end_headers() - html = "

Hello lit world " + # Data must be passed as bytes to the `self.wfile.write` call + html = b"

Hello lit world " self.wfile.write(html) @@ -81,7 +83,8 @@ In this case, we render the ``LitServer`` output in the ``home`` tab of the appl def do_GET(self): self.send_response(HTTPStatus.OK) self.end_headers() - html = "

Hello lit world " + # Data must be passed as bytes to the `self.wfile.write` call + html = b"

Hello lit world " self.wfile.write(html)