title: Why is print not showing the whole line?
body: <p>Why when I'm printing the request.decode(&quot;utf-8&quot;) the first of the line isn't printed, I tried a lot of things and concluded that whenever there is some text before it and in the exact same line, it will be ignored. (adding a print with end='' is ignored too)<br></p>
  <p>SYN is what I receive from the TCP client.
  The output is in the end.</p>
  <pre><code>import threading
  
  IP = '0.0.0.0'
  PORT = 9998
  
  def main():
      server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
      server.bind((IP, PORT))
  
      server.listen(5)
      print(f'[*] Listening on {IP} : {PORT}')
  
      while True:
  
          client, address = server.accept()
          print(f'[*] Accepted connection from {address[0]}:{address[1]}')
          client_handler = threading.Thread(target=handle_client, args=(client,))
          client_handler.start()
  
  def handle_client(socket):
      with socket as sock:
          request = sock.recv(1024)
          print(f'[*] Received: {request.decode(&quot;utf-8&quot;)}')
          sock.send(b'AKNOWLEDGEMENT')
  
  if __name__ == '__main__':
      main()
  </code></pre>
  <p><strong>Output:</strong></p>
  <pre><code>[*] Listening on 0.0.0.0 : 9998
  [*] Accepted connection from 127.0.0.1:22703
  SYN
  </code></pre>