Parsing of IPv6 proxies is broken in urllib

Bug #1549998 reported by Ante Karamatić
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-urllib3 (Ubuntu)
Fix Released
High
Unassigned

Bug Description

When IPv6 proxies are used, urllib in 14.04 won't work always. Example with 'neutron net-list':

⟫ neutron --debug net-list
DEBUG: neutronclient.neutron.v2_0.network.ListNetwork get_data(Namespace(columns=[], fields=[], formatter='table', page_size=None, quote_mode='nonnumeric', request_format='json', show_details=False, sort_dir=[], sort_key=[]))
DEBUG: neutronclient.client
REQ: curl -i http://192.168.0.1:5000/v2.0/tokens -X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "User-Agent: python-neutronclient" -d '{"auth": {"tenantName": "test", "passwordCredentials": {"username": "test", "password": "test"}}}'

DEBUG: neutronclient.client throwing ConnectionFailed : invalid literal for int() with base 10: 'ea2a:eaff:fe39:a800]:8080'
ERROR: neutronclient.shell Connection to neutron failed: invalid literal for int() with base 10: 'ea2a:eaff:fe39:a800]:8080'
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/neutronclient/shell.py", line 526, in run_subcommand
    return run_command(cmd, cmd_parser, sub_argv)
  File "/usr/lib/python2.7/dist-packages/neutronclient/shell.py", line 79, in run_command
    return cmd.run(known_args)
  File "/usr/lib/python2.7/dist-packages/neutronclient/common/command.py", line 34, in run
    return super(OpenStackCommand, self).run(parsed_args)
  File "/usr/lib/python2.7/dist-packages/cliff/display.py", line 84, in run
    column_names, data = self.take_action(parsed_args)
  File "/usr/lib/python2.7/dist-packages/neutronclient/common/command.py", line 40, in take_action
    return self.get_data(parsed_args)
  File "/usr/lib/python2.7/dist-packages/neutronclient/neutron/v2_0/__init__.py", line 610, in get_data
    data = self.retrieve_list(parsed_args)
  File "/usr/lib/python2.7/dist-packages/neutronclient/neutron/v2_0/__init__.py", line 556, in retrieve_list
    neutron_client = self.get_client()
  File "/usr/lib/python2.7/dist-packages/neutronclient/neutron/v2_0/__init__.py", line 350, in get_client
    return self.app.client_manager.neutron
  File "/usr/lib/python2.7/dist-packages/neutronclient/common/clientmanager.py", line 40, in __get__
    self._handle = self.factory(instance)
  File "/usr/lib/python2.7/dist-packages/neutronclient/neutron/client.py", line 36, in make_client
    instance.initialize()
  File "/usr/lib/python2.7/dist-packages/neutronclient/common/clientmanager.py", line 94, in initialize
    httpclient.authenticate()
  File "/usr/lib/python2.7/dist-packages/neutronclient/client.py", line 239, in authenticate
    content_type="application/json")
  File "/usr/lib/python2.7/dist-packages/neutronclient/client.py", line 154, in _cs_request
    raise exceptions.ConnectionFailed(reason=e)
ConnectionFailed: Connection to neutron failed: invalid literal for int() with base 10: 'ea2a:eaff:fe39:a800]:8080'
DEBUG: neutronclient.shell clean_up ListNetwork
DEBUG: neutronclient.shell Got an error: Connection to neutron failed: invalid literal for int() with base 10: 'ea2a:eaff:fe39:a800]:8080'

This has been fixed with urllib 1.11:

https://github.com/shazow/urllib3/pull/668/files

Ante Karamatić (ivoks)
Changed in python (Ubuntu):
importance: Undecided → High
tags: added: cpec
Ante Karamatić (ivoks)
tags: removed: cpec
affects: python (Ubuntu) → python-urllib3 (Ubuntu)
Changed in python-urllib3 (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.