Skip to content

Commit db71ea4

Browse files
Davies Liudavies
authored andcommitted
[SPARK-8976] [PYSPARK] fix open mode in python3
This bug only happen on Python 3 and Windows. I tested this manually with python 3 and disable python daemon, no unit test yet. Author: Davies Liu <[email protected]> Closes #8181 from davies/open_mode. (cherry picked from commit 693949b) Signed-off-by: Davies Liu <[email protected]>
1 parent 041e720 commit db71ea4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/pyspark/worker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,5 +146,5 @@ def process():
146146
java_port = int(sys.stdin.readline())
147147
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
148148
sock.connect(("127.0.0.1", java_port))
149-
sock_file = sock.makefile("a+", 65536)
149+
sock_file = sock.makefile("rwb", 65536)
150150
main(sock_file, sock_file)

0 commit comments

Comments
 (0)