title: pyspark traceback: 'utf8' codec can't decode byte 0xce in position 22: invalid continuation byte
body: <p>It's my code to run spark in python, and I just follow the code provided by others, but traceback:'utf8' codec can't decode byte 0xce in position 22: invalid continuation byte</p>
  
  <pre><code># -*- coding: utf-8 -*-
  from pyspark import SparkContext, SparkConf
  import os
  import sys
  reload(sys)
  sys.setdefaultencoding('utf-8')
  os.environ['SPARK_HOME'] = r'D:\spark-2.1.0-bin-hadoop2.7'
  appName ="jhl_spark_1"
  master= "local"
  conf = SparkConf().setAppName(appName).setMaster(master)
  sc = SparkContext(conf=conf)
  
  rdd = sc.parallelize([2, 3, 4])
  print sorted(rdd.flatMap(lambda x: range(1, x)).collect())
  </code></pre>
  
  <p>and the traceback:</p>
  
  <pre><code> File "F:/eclipse/�ı��ھ�/������APRIORI/spark.py", line 14, in &lt;module&gt;
   print sorted(rdd.flatMap(lambda x: range(1, x)).collect())
   File "D:\Anaconda2\lib\site-packages\pyspark\rdd.py", line 808, in collect with SCCallSiteSync(self.context) as css:
   File "D:\Anaconda2\lib\site-packages\pyspark\traceback_utils.py", line 72, in __enter__self._context._jsc.setCallSite(self._call_site)
   File "D:\Anaconda2\lib\site-packages\py4j\java_gateway.py", line 1124, in __call__args_command, temp_args = self._build_args(*args)
   File "D:\Anaconda2\lib\site-packages\py4j\java_gateway.py", line 1094, in _build_args
  [get_command_part(arg, self.pool) for arg in new_args])
   File "D:\Anaconda2\lib\site-packages\py4j\protocol.py", line 283, in get_command_part
  command_part = STRING_TYPE + escape_new_line(parameter)
   File "D:\Anaconda2\lib\site-packages\py4j\protocol.py", line 183, in escape_new_line
  return smart_decode(original).replace("\\", "\\\\").replace("\r", "\\r").\
   File "D:\Anaconda2\lib\site-packages\py4j\protocol.py", line 210, in smart_decode
  return unicode(s, "utf-8")
  UnicodeDecodeError: 'utf8' codec can't decode byte 0xce in position 22: invalid continuation byte
  </code></pre>