Github user rilut commented on the pull request:

    https://github.com/apache/spark/pull/5173#issuecomment-113410652
  
    I'm on Python 3.4.3 (Anaconda 2.2.0 64-bit, Windows 10 x64) and 
experiencing a problem.
    
        >>> sc.parallelize([1, 2]).count()
        ....
        File "C:\Anaconda3\lib\socket.py", line 205, in makefile
        raise ValueError("invalid mode %r (only r, w, b allowed)" % (mode,))
        ValueError: invalid mode 'a+' (only r, w, b allowed)
        15/06/19 14:10:54 WARN PythonRDD: Incomplete task interrupted: 
Attempting to kill Python Worker
        ....
    
    I think it's because of 
https://github.com/apache/spark/blob/master/python/pyspark/worker.py#L149 .
    I'm not sure if `a+` mode exists in Python 3.
    
        >>> import socket
        >>> sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        >>> sock.connect(("127.0.0.1", 4040))
        >>> sock_file = sock.makefile("a+", 65536) ## failed
        Traceback (most recent call last):
          File "<stdin>", line 1, in <module>
          File "C:\Anaconda3\lib\socket.py", line 205, in makefile
            raise ValueError("invalid mode %r (only r, w, b allowed)" % (mode,))
        ValueError: invalid mode 'a+' (only r, w, b allowed)
        >>> sock_file = sock.makefile("r", 65536) ## r is okay
        >>> sock_file = sock.makefile("x", 65536) ## x is obviously doesn't 
exists, I'm making this up.
        Traceback (most recent call last):
          File "<stdin>", line 1, in <module>
          File "C:\Anaconda3\lib\socket.py", line 205, in makefile
            raise ValueError("invalid mode %r (only r, w, b allowed)" % (mode,))
        ValueError: invalid mode 'x' (only r, w, b allowed)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to