Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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'

Open
#227 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from realpython/materials

All issues in realpython/materials

Similar issues

More Networking issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.