Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

macOS 10.11 download failures using "system" python 2.7.10 #134

Description

@jadeallenx

Ran into this today, when I was trying to update pythonz - if you're using the Apple-shipped python 2.7.10, the SSL libraries linked here don't support TLS 1.2 so github (and a lot of other HTTPS sites are refusing traffic.)

See this post on the python.org blog for more details

Python2.7.10 (default, Oct232015, 19:19:21) [GCC4.2.1CompatibleAppleLLVM7.0.0 (clang-700.0.59.5)] ondarwinType"help", "copyright", "credits"or"license"formoreinformation.
>>>fromurllibimporturlretrieve>>>urlretrieve("https://github.com/saghul/pythonz/archive/master.tar.gz", "/tmp/test.tgz")
Traceback (mostrecentcalllast):
File"<stdin>", line1, in<module>File"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line98, inurlretrievereturnopener.retrieve(url, filename, reporthook, data)
File"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line245, inretrievefp=self.open(url, data)
File"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line213, inopenreturngetattr(self, name)(url)
File"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line443, inopen_httpsh.endheaders(data)
File"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line1049, inendheadersself._send_output(message_body)
File"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line893, in_send_outputself.send(msg)
File"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line855, insendself.connect()
File"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line1274, inconnectserver_hostname=server_hostname)
File"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line352, inwrap_socket_context=self)
File"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line579, in__init__self.do_handshake()
File"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line808, indo_handshakeself._sslobj.do_handshake()
IOError: [Errnosocketerror] [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1alertprotocolversion (_ssl.c:590)
>>>fromurllib2importurlopen>>>req=urlopen("https://www.howsmyssl.com/a/check")
>>>importjson>>>resp=json.loads(req.readline())
>>>resp['tls_version']
"TLS 1.0"

So what can you do?

  1. Upgrade your mac OS installation
  2. Install python2 or 3 using homebrew and make sure it comes in your path before the system python
  3. Modify $HOME/.pythonz/bin/pythonz to explicitly call a newer python than whatever shows up first in your path. (This is what I did.)

As far as I can tell those are your only viable options. This isn't a "pythonz" issue per se, but it will stop pythonz from working correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions