Github user meawoppl commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6336#discussion_r30910102
  
    --- Diff: ec2/spark_ec2.py ---
    @@ -423,13 +426,14 @@ def get_spark_ami(opts):
             b=opts.spark_ec2_git_branch)
     
         ami_path = "%s/%s/%s" % (ami_prefix, opts.region, instance_type)
    +    reader = codecs.getreader("ascii")
         try:
    -        ami = urlopen(ami_path).read().strip()
    -        print("Spark AMI: " + ami)
    +        ami = reader(urlopen(ami_path)).read().strip()
    --- End diff --
    
    I was totally wrong.  Streamreader only deals with bytes, but because 
urlopen() is pulled from urllib.request in py3 and from urllib2 in py2, both 
produce bytestreams, which is why both work.
    
    I can swap that call out for decode if it seems more obvious/maintainable.  
The behavior will be equivalent.  


---
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