1

**When I type "dir" in the console I receive this error and the error shows this line " client_response = str(conn.recv(1024), "utf-8")" **

def socket_accept():

conn, address = s.accept()
print("Connection has been established | " + "IP " + address[0] + "| Port " + str(address[1]))
send_commands(conn)
conn.close()


def send_commands(conn):

while True:
    cmd = input()
    if cmd == 'quit':
        conn.close()
        s.close()
        sys.exit()
    if len(str.encode(cmd)) > 0:
        conn.send(str.encode(cmd))
        client_response = str(conn.recv(1024), "utf-8")
        print(client_response, end ="")
Ahsan Javaid
  • 113
  • 1
  • 2
  • 9
  • in http://www.stackoverflow.com/questions/1472876/why-is-host-aborting-connection is exactly the same behavior – ralf htp Feb 21 '17 at 16:08
  • Possible duplicate of [Why is host aborting connection?](http://stackoverflow.com/questions/1472876/why-is-host-aborting-connection) – ralf htp Feb 21 '17 at 16:10

1 Answers1

0

Refer following link - it says upgrade python to 3.7.3 or higher version:

Django ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine

amandeep1991
  • 1,344
  • 13
  • 17