hi There, upon running the codes below, i have the problem in the last 2 lines : sock.sendto(message.format(i, time.asctime()), server_address) TypeError: a bytes-like object is required, not 'str'
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- networking
Research direction
Start by running the UDP socket snippet shown in the issue and inspect the arguments passed to sock.sendto. Confirm that the example completes all 15 sends without the reported TypeError and that its documented behavior remains intact.
Written by the indexing model from the issue text.
Description
Import Module
import socket
import time
Create a TCP/IP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
Connect the socket to the port where the server is listening
server_address = ("localhost", 10000)
print('[+] Connecting to %s Port %s' % server_address)
message="Message No. {} | Sent By Client At Time {} "
for i in range(15):
sock.sendto(message.format(i, time.asctime()), server_address)
- Dominant language
- Jupyter Notebook
- Stars
- 5.2k
- Forks
- 5.3k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 10
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from realpython/materials
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
realpython/materials#729 ·
-
п Open
Difficulty 5/5 Over a week Newbie friendliness 1/100
realpython/materials#763 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 55/100
realpython/materials#738 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 45/100
realpython/materials#737 ·
-
проект2 Open
Difficulty 5/5 Over a week Newbie friendliness 15/100
realpython/materials#725 ·
All issues in realpython/materials
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
canonical/postgresql-watcher-operator#110 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
EleutherAI/lm-evaluation-harness#4201 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
possible bug Stage1
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PrismarineJS/mineflayer#4147 ·