[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 <davies@databricks.com>

Closes #8181 from davies/open_mode.
This commit is contained in:
Davies Liu 2015-08-13 17:33:37 -07:00 committed by Davies Liu
parent 6c5858bc65
commit 693949ba40

View file

@ -146,5 +146,5 @@ if __name__ == '__main__':
java_port = int(sys.stdin.readline())
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(("127.0.0.1", java_port))
sock_file = sock.makefile("a+", 65536)
sock_file = sock.makefile("rwb", 65536)
main(sock_file, sock_file)