Skip to content

Commit 65e01f2

Browse files
authored
Merge pull request #1670 from docker/2.4.1-release
2.4.1 release
2 parents 706e2ca + 3d84dbe commit 65e01f2

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

docker/utils/ports.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def port_range(start, end, proto, randomly_available_port=False):
5454

5555

5656
def split_port(port):
57+
port = str(port)
5758
match = PORT_SPEC.match(port)
5859
if match is None:
5960
_raise_invalid_port(port)

docker/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version = "2.4.0"
1+
version = "2.4.1"
22
version_info = tuple([int(d) for d in version.split("-")[0].split(".")])

docs/change-log.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
Change log
22
==========
33

4+
2.4.1
5+
-----
6+
7+
[List of PRs / issues for this release](https://github.com/docker/docker-py/milestone/35?closed=1)
8+
9+
### Bugfixes
10+
11+
* Fixed a bug where the `split_port` utility would raise an exception when
12+
passed a non-string argument.
13+
414
2.4.0
515
-----
616

tests/unit/utils_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,9 @@ def test_with_no_container_port(self):
587587
def test_split_port_empty_string(self):
588588
self.assertRaises(ValueError, lambda: split_port(""))
589589

590+
def test_split_port_non_string(self):
591+
assert split_port(1243) == (['1243'], None)
592+
590593
def test_build_port_bindings_with_one_port(self):
591594
port_bindings = build_port_bindings(["127.0.0.1:1000:1000"])
592595
self.assertEqual(port_bindings["1000"], [("127.0.0.1", "1000")])

0 commit comments

Comments
 (0)