You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the file ./utils/socket.py line 31 hava code os.read(socket.fileno(), n) but windows not support
my call container.exec_run("xxx", socket=False) raise:
Traceback (most recent call last):
File "E:/projects/python/judgeClient/judge.py", line 34, in
ret, s = container.exec_run("javac Main.java", workdir="/judge", socket=False)
File "D:\Python35\lib\site-packages\docker\models\containers.py", line 185, in exec_run
resp['Id'], detach=detach, tty=tty, stream=stream, socket=socket
File "D:\Python35\lib\site-packages\docker\utils\decorators.py", line 19, in wrapped
return f(self, resource_id, *args, **kwargs)
File "D:\Python35\lib\site-packages\docker\api\exec_api.py", line 165, in exec_start
return self._read_from_socket(res, stream, tty)
File "D:\Python35\lib\site-packages\docker\api\client.py", line 373, in _read_from_socket
return six.binary_type().join(gen)
File "D:\Python35\lib\site-packages\docker\utils\socket.py", line 75, in frames_iter
n = next_frame_size(socket)
File "D:\Python35\lib\site-packages\docker\utils\socket.py", line 62, in next_frame_size
data = read_exactly(socket, 8)
File "D:\Python35\lib\site-packages\docker\utils\socket.py", line 47, in read_exactly
next_data = read(socket, n - len(data))
File "D:\Python35\lib\site-packages\docker\utils\socket.py", line 32, in read
return os.read(socket.fileno(), n)
OSError: [Errno 9] Bad file descriptor
The text was updated successfully, but these errors were encountered:
@zhangyanwei
rewrite read function in utils\socket.py
def read(socket, n=4096):
"""
Reads at most n bytes from socket
"""
recoverable_errors = (errno.EINTR, errno.EDEADLK, errno.EWOULDBLOCK)
if six.PY3 and not isinstance(socket, NpipeSocket):
select.select([socket], [], [])
try:
if hasattr(socket, 'recv'):
return socket.recv(n)
# fix OSError
try:
return os.read(socket.fileno(), n)
except OSError:
return socket.read(n)
except EnvironmentError as e:
if e.errno not in recoverable_errors:
raise
the file ./utils/socket.py line 31 hava code
os.read(socket.fileno(), n)
but windows not supportmy call container.exec_run("xxx", socket=False) raise:
Traceback (most recent call last):
File "E:/projects/python/judgeClient/judge.py", line 34, in
ret, s = container.exec_run("javac Main.java", workdir="/judge", socket=False)
File "D:\Python35\lib\site-packages\docker\models\containers.py", line 185, in exec_run
resp['Id'], detach=detach, tty=tty, stream=stream, socket=socket
File "D:\Python35\lib\site-packages\docker\utils\decorators.py", line 19, in wrapped
return f(self, resource_id, *args, **kwargs)
File "D:\Python35\lib\site-packages\docker\api\exec_api.py", line 165, in exec_start
return self._read_from_socket(res, stream, tty)
File "D:\Python35\lib\site-packages\docker\api\client.py", line 373, in _read_from_socket
return six.binary_type().join(gen)
File "D:\Python35\lib\site-packages\docker\utils\socket.py", line 75, in frames_iter
n = next_frame_size(socket)
File "D:\Python35\lib\site-packages\docker\utils\socket.py", line 62, in next_frame_size
data = read_exactly(socket, 8)
File "D:\Python35\lib\site-packages\docker\utils\socket.py", line 47, in read_exactly
next_data = read(socket, n - len(data))
File "D:\Python35\lib\site-packages\docker\utils\socket.py", line 32, in read
return os.read(socket.fileno(), n)
OSError: [Errno 9] Bad file descriptor
The text was updated successfully, but these errors were encountered: