Commit 00ed1eeb authored by Andrei Vagin's avatar Andrei Vagin Committed by Pavel Emelyanov

test: make zdtm.py python2/python3 compatible

Cc: Adrian Reber <areber@redhat.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent a6748591
......@@ -8,8 +8,8 @@ def create_fds():
raise Exception("Unable to mount tmpfs")
tfifo = os.path.join(tdir, "test_fifo")
os.mkfifo(tfifo)
fd2 = open(tfifo, "w+")
fd1 = open(tfifo, "r")
fd2 = open(tfifo, "w+b", buffering=0)
fd1 = open(tfifo, "rb")
os.system("umount -l %s" % tdir)
os.rmdir(tdir)
......
......@@ -2,7 +2,7 @@ import os
def create_fds():
(fd1, fd2) = os.pipe()
return (os.fdopen(fd2, "w"), os.fdopen(fd1, "r"))
return (os.fdopen(fd2, "wb"), os.fdopen(fd1, "rb"))
def filename(pipef):
return 'pipe:[%d]' % os.fstat(pipef.fileno()).st_ino
......
......@@ -3,7 +3,7 @@ import os
def create_fds():
(sk1, sk2) = socket.socketpair(socket.AF_UNIX, socket.SOCK_STREAM)
return (sk1.makefile("w"), sk2.makefile("r"))
return (sk1.makefile("wb"), sk2.makefile("rb"))
def __sock_ino(sockf):
return os.fstat(sockf.fileno()).st_ino
......
......@@ -6,7 +6,7 @@ def child_prep(fd):
def create_fds():
(fd1, fd2) = pty.openpty()
return (os.fdopen(fd2, "w"), os.fdopen(fd1, "r"))
return (os.fdopen(fd2, "wb"), os.fdopen(fd1, "rb"))
def filename(pipef):
st = os.fstat(pipef.fileno())
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment