Issue2421

classification
Title: UnboundLocalError: local variable 'key_store' referenced before assignment in _sslverify.py
Type: crash Severity: normal
Components: Library Versions: Jython 2.7
Milestone: Jython 2.7.1
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: zyasoft Nosy List: darjus, teeohhem, zyasoft
Priority: Keywords:

Created on 2015-11-03.17:15:43 by teeohhem, last changed 2015-11-21.16:29:24 by zyasoft.

Messages
msg10433 (view) Author: Tom Alexander (teeohhem) Date: 2015-11-03.17:18:12
In Jython 2.7.1b2, I receive the following stack trace when trying to use any portion of the ssl lib

2015-11-03 12:13:25-0500 [-]   File "/Users/talexander/source/ripcord/opscenterd/lib/py/twisted/internet/ssl.py", line 104, in __init__
2015-11-03 12:13:25-0500 [-]     self.cacheContext()
2015-11-03 12:13:25-0500 [-]   File "/Users/talexander/source/ripcord/opscenterd/lib/py/twisted/internet/ssl.py", line 113, in cacheContext
2015-11-03 12:13:25-0500 [-]     ctx.load_cert_chain(self.certificateFileName, keyfile=self.privateKeyFileName)  # Automatically checks against private key
2015-11-03 12:13:25-0500 [-]   File "/Users/talexander/source/ripcord/opscenterd/lib/jvm/org/python/jython-standalone/2.7.1b2/jython-standalone-2.7.1b2.bak.jar/Lib/ssl.py", line 495, in load_cert_chain
2015-11-03 12:13:25-0500 [-]     self._key_managers = _get_openssl_key_manager(certfile, keyfile, password, _key_store=self._key_store)
2015-11-03 12:13:25-0500 [-]   File "/Users/talexander/source/ripcord/opscenterd/lib/jvm/org/python/jython-standalone/2.7.1b2/jython-standalone-2.7.1b2.bak.jar/Lib/_sslcerts.py", line 108, in _get_openssl_key_manager
2015-11-03 12:13:25-0500 [-]     key_store.setKeyEntry(str(uuid.uuid4()), private_key, [], certs)
2015-11-03 12:13:25-0500 [-] UnboundLocalError: local variable 'key_store' referenced before assignment
msg10434 (view) Author: Jim Baker (zyasoft) Date: 2015-11-03.23:56:18
Basic programming error - _keystore vs keystore - surprised that this hasn't come up before. Should be an easy fix.
msg10461 (view) Author: Tom Alexander (teeohhem) Date: 2015-11-12.15:16:06
Submitted a patch: https://github.com/jythontools/jython/pull/23
msg10479 (view) Author: Jim Baker (zyasoft) Date: 2015-11-14.16:07:36
Should be fixed as of https://hg.python.org/jython/rev/17443ce4824e, although no direct coverage testing
History
Date User Action Args
2015-11-21 16:29:24zyasoftsetstatus: pending -> closed
2015-11-14 16:07:36zyasoftsetstatus: open -> pending
resolution: accepted -> fixed
messages: + msg10479
2015-11-12 15:16:06teeohhemsetmessages: + msg10461
2015-11-03 23:56:44zyasoftsetassignee: zyasoft
resolution: accepted
2015-11-03 23:56:18zyasoftsetnosy: + darjus, zyasoft
messages: + msg10434
milestone: Jython 2.7.1
2015-11-03 17:18:13teeohhemsetmessages: + msg10433
2015-11-03 17:15:44teeohhemcreate