import os
import errno
import select

def expect_eof(fd):
  r, _, _ = select.select([fd], [], [])
  if fd not in r:
    raise AssertionError("Expected EOF, fd not readable")
  try:
    data = os.read(fd, 1024)
    if len(data) == 0:
      return
    raise AssertionError("Expected EOF, got read: `{}'".format(data))
  except OSError as e:
    if e.errno == errno.EIO:
      return
    raise AssertionError("Expected EOF, other expection: {}".format(e))

@@ -422,19 +422,19 @@
 other ex
-pec
+cep
 tion: %7B%7D

Fix typo