NaCl SDK install script broken on OSX for anybody else?

85 views
Skip to first unread message

Floh

unread,
Jan 24, 2015, 1:28:44 PM1/24/15
to native-cli...@googlegroups.com
Hi,

did the naclsdk script update very recently? I'm suddenly getting a python 'crash' when calling ./naclsdk on OSX with python 2.7.9. It works on my Linux VM with python 2.7.6. This seems to be same problem as described here: http://stackoverflow.com/questions/27654669/cannot-use-google-native-client-sdk-on-windows-7. I'm pretty sure it worked about a week ago.

Python stack trace:

Traceback (most recent call last):
  File "/Users/floh/projects/fips-sdks/osx/nacl_sdk/sdk_tools/sdk_update_main.py", line 759, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/Users/floh/projects/fips-sdks/osx/nacl_sdk/sdk_tools/sdk_update_main.py", line 752, in main
    InvokeCommand(args)
  File "/Users/floh/projects/fips-sdks/osx/nacl_sdk/sdk_tools/sdk_update_main.py", line 741, in InvokeCommand
    command(options, args[1:], config)
  File "/Users/floh/projects/fips-sdks/osx/nacl_sdk/sdk_tools/sdk_update_main.py", line 510, in Update
    manifest = LoadManifestFromURLs([options.manifest_url] + config.GetSources())
  File "/Users/floh/projects/fips-sdks/osx/nacl_sdk/sdk_tools/sdk_update_main.py", line 238, in LoadManifestFromURLs
    url_stream = UrlOpen(url)
  File "/Users/floh/projects/fips-sdks/osx/nacl_sdk/sdk_tools/sdk_update_main.py", line 114, in UrlOpen
    return url_opener.open(request)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 431, in open
    response = self._open(req, data)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 449, in _open
    '_open', req)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1240, in https_open
    context=self._context)
TypeError: do_open() got an unexpected keyword argument 'context'

Floh

unread,
Jan 24, 2015, 1:45:07 PM1/24/15
to native-cli...@googlegroups.com
Some digging revealed that this seems to be a bug in Python 2.7.9's FancyHTTPHandler:

https://code.google.com/p/googleappengine/issues/detail?id=11536

This is pretty bad since Python 2.7.9 is the default Python version on OSX 10.10, would be good if the naclsdk implements a workaround for this (it worked until very recently).

Floh

unread,
Jan 24, 2015, 1:51:31 PM1/24/15
to native-cli...@googlegroups.com
Correction: the default OSX Python version is 2.7.6, and this works. My 2.7.9 version is from homebrew.

-Floh.

Nick Daniels

unread,
Jan 26, 2015, 10:11:40 AM1/26/15
to native-cli...@googlegroups.com
Well that answers that question. Thanks.

Ben Smith

unread,
Jan 26, 2015, 5:17:29 PM1/26/15
to native-cli...@googlegroups.com
Thanks for reporting this. I've filed a bug here: http://crbug.com/452137.

As a workaround, try modifying fancy_urllib in the same way as described in the googleappengine issue above:

index d4da0dd..dfbad4d 100644
--- a/sdk_tools/third_party/fancy_urllib/__init__.py
+++ b/sdk_tools/third_party/fancy_urllib/__init__.py
@@ -329,7 +329,7 @@ class FancyProxyHandler(urllib2.ProxyHandler):
 class FancyHTTPSHandler(urllib2.HTTPSHandler):
   """An HTTPSHandler that works with CONNECT-enabled proxies."""
 
-  def do_open(self, http_class, req):
+  def do_open(self, http_class, req, **kwargs):
     # Intentionally very specific so as to opt for false negatives
     # rather than false positives.
     try:
@@ -339,7 +339,8 @@ class FancyHTTPSHandler(urllib2.HTTPSHandler):
                                    req._key_file,
                                    req._cert_file,
                                    req._ca_certs),
-          req)
+          req,
+          **kwargs)
     except urllib2.URLError, url_error:
       try:
         import ssl

-Ben
Reply all
Reply to author
Forward
0 new messages