lmacken / quantumrandom

Tools for utilizing the ANU Quantum Random Number Generator
https://pypi.python.org/pypi/quantumrandom
146 stars 36 forks source link

Error in python3.4 OSX 10.10 #17

Closed wakwanza closed 8 years ago

wakwanza commented 9 years ago

Getting an error working with the library in OSX .Native python2.7 works as expected with proper calls getting answered .On same machine fails with python3.

Env info: OSX 10.10.2 Python 3.4.3 (default, Mar 10 2015, 14:53:35) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin

error:

>>> quantumrandom.get_data()
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/request.py", line 1182, in do_open
    h.request(req.get_method(), req.selector, req.data, headers)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/http/client.py", line 1088, in request
    self._send_request(method, url, body, headers)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/http/client.py", line 1126, in _send_request
    self.endheaders(body)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/http/client.py", line 1084, in endheaders
    self._send_output(message_body)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/http/client.py", line 922, in _send_output
    self.send(msg)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/http/client.py", line 857, in send
    self.connect()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/http/client.py", line 1231, in connect
    server_hostname=server_hostname)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/ssl.py", line 365, in wrap_socket
    _context=self)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/ssl.py", line 583, in __init__
    self.do_handshake()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/ssl.py", line 810, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/quantumrandom/__init__.py", line 60, in get_data
    data = get_json(url)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/quantumrandom/__init__.py", line 77, in get_json
    return json.loads(urlopen(url).read().decode('ascii'))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/request.py", line 161, in urlopen
    return opener.open(url, data, timeout)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/request.py", line 463, in open
    response = self._open(req, data)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/request.py", line 481, in _open
    '_open', req)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/request.py", line 441, in _call_chain
    result = func(*args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/request.py", line 1225, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/request.py", line 1184, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)>
lmacken commented 9 years ago

Are you at PyCon by chance? I wonder if this is due to a wifi captive portal or something of the sort.

wakwanza commented 9 years ago

Hmm yeah was going through a wifi connection with a captive portal .Though got similar result on my home network.Using py2.7 as default for now. so will try and follow up on the py3 part of the project at a later time.

lmacken commented 8 years ago

Please re-open this ticket if you are still experiencing this problem on OSX.

oldaccountdeadname commented 5 years ago

I'm getting this issue on Windows connected through powerline ethernet. I'm just at home on my own network... What do you think the issue is?