Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def _url(self, pathfmt, *args, **kwargs):
'instead'.format(arg, type(arg))
)

quote_f = partial(six.moves.urllib.parse.quote_plus, safe="/:")
quote_f = partial(six.moves.urllib.parse.quote, safe="/:")
args = map(quote_f, args)

if kwargs.get('versioned_api', True):
Expand Down
7 changes: 7 additions & 0 deletions tests/integration/api_network_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,3 +484,10 @@ def test_create_inspect_network_with_scope(self):
assert self.client.inspect_network(net_name_swarm, scope='swarm')
with pytest.raises(docker.errors.NotFound):
self.client.inspect_network(net_name_swarm, scope='local')

@requires_api_version('1.21')
def test_create_remove_network_with_space_in_name(self):
net_id = self.client.create_network('test 01')
self.tmp_networks.append(net_id)
assert self.client.inspect_network('test 01')
assert self.client.remove_network('test 01') is None # does not raise