Skip to content

Commit 77c9819

Browse files
committed
Final QA
1 parent e2c8871 commit 77c9819

File tree

7 files changed

+9
-13
lines changed

7 files changed

+9
-13
lines changed

python-bytes-to-strings/decode_bytes1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
with urlopen(url) as response:
66
raw_bytes: bytes = response.read()
77

8-
print(f"Bytes: {raw_bytes[:100]}\n")
8+
print("Bytes:", raw_bytes[:100])

python-bytes-to-strings/decode_bytes2.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,5 @@
55
with urlopen(url) as response:
66
raw_bytes: bytes = response.read()
77

8-
print(f"Bytes: {raw_bytes[:100]}\n")
9-
10-
string_format = raw_bytes[:100].decode()
11-
12-
print(f"String format: {string_format}\n")
8+
print("Bytes:", raw_bytes[:100])
9+
print("String:", raw_bytes[:100].decode())
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
encoded_text = b"d\xe9j\xe0 vu"
2+
3+
print(f"{encoded_text.decode("utf-8", errors="ignore") = }")
4+
print(f"{encoded_text.decode("utf-8", errors="replace") = }")
5+
print(f"{encoded_text.decode("utf-8", errors="backslashreplace") = }")
6+
print(f"{encoded_text.decode('utf-8')}")
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
raw_bytes = b"These are some interesting bytes"
22
raw_bytes.replace("y", "o")
3-
4-
print(raw_bytes)

python-bytes-to-strings/raw_bytes.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

python-bytes-to-strings/replace_option_example.py

Lines changed: 0 additions & 2 deletions
This file was deleted.

python-bytes-to-strings/unicode_decode_error.py

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)