Issue2698

classification
Title: urllib2.URLError:
Type: crash Severity: major
Components: Core Versions: Jython 2.7
Milestone:
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: amak, wheelerlaw
Priority: Keywords:

Created on 2018-07-20.15:27:06 by wheelerlaw, last changed 2018-07-20.16:22:40 by amak.

Messages
msg12060 (view) Author: Wheeler Law (wheelerlaw) Date: 2018-07-20.15:29:21
import json
import urllib2
import base64
import getpass

username = raw_input("Username: ")
password = getpass.getpass("Password: ")
base64UsernamePassword = base64.b64encode(username + ":" + password)

request = urllib2.Request("https://<myhttpsurl>/", headers={"Authorization": "Basic " + base64UsernamePassword})
response = urllib2.urlopen(request).read()


I get the following error:

Traceback (most recent call last):
  File "/home/wlaw/openshift_xlr_templates/src/infrastructureValidator/InfrastructureValidator.py", line 12, in <module>
    response = urllib2.urlopen(request).read()
  File "/usr/share/jython/Lib/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/share/jython/Lib/urllib2.py", line 429, in open
    response = self._open(req, data)
  File "/usr/share/jython/Lib/urllib2.py", line 451, in _open
    return self._call_chain(self.handle_open, 'unknown',
  File "/usr/share/jython/Lib/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/share/jython/Lib/urllib2.py", line 1266, in unknown_open
    raise URLError('unknown url type: %s' % type)
urllib2.URLError: <urlopen error unknown url type: https>
History
Date User Action Args
2018-07-20 16:22:40amaksetnosy: + amak
2018-07-20 15:34:22wheelerlawsettype: behaviour -> crash
2018-07-20 15:31:45wheelerlawsetmilestone: Jython 2.7.1 ->
2018-07-20 15:29:22wheelerlawsetmessages: + msg12060
2018-07-20 15:27:06wheelerlawcreate