Skip to content

Commit 31080c9

Browse files
krshrimaliFelonious-Spellfireethanwharristchaton
committed
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 <[email protected]> Co-authored-by: Ethan Harris <[email protected]> Co-authored-by: thomas chaton <[email protected]>
1 parent ef04452 commit 31080c9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

docs/source-app/workflows/add_server/any_server.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ Any server that listens on a port, can be enabled via a work. For example, here'
3131
def do_GET(self):
3232
self.send_response(HTTPStatus.OK)
3333
self.end_headers()
34-
html = "<h1 style='color: blue'> Hello lit world </div>"
34+
# Data must be passed as bytes to the `self.wfile.write` call
35+
html = b"<h1 style='color: blue'> Hello lit world </div>"
3536
self.wfile.write(html)
3637
3738
@@ -52,7 +53,8 @@ To enable the server inside the component, start the server in the run method an
5253
def do_GET(self):
5354
self.send_response(HTTPStatus.OK)
5455
self.end_headers()
55-
html = "<h1 style='color: blue'> Hello lit world </div>"
56+
# Data must be passed as bytes to the `self.wfile.write` call
57+
html = b"<h1 style='color: blue'> Hello lit world </div>"
5658
self.wfile.write(html)
5759
5860
@@ -81,7 +83,8 @@ In this case, we render the ``LitServer`` output in the ``home`` tab of the appl
8183
def do_GET(self):
8284
self.send_response(HTTPStatus.OK)
8385
self.end_headers()
84-
html = "<h1 style='color: blue'> Hello lit world </div>"
86+
# Data must be passed as bytes to the `self.wfile.write` call
87+
html = b"<h1 style='color: blue'> Hello lit world </div>"
8588
self.wfile.write(html)
8689
8790

0 commit comments

Comments
 (0)