From 3804bcb8ccb43aa0f94b3bd25110ad395f716813 Mon Sep 17 00:00:00 2001 From: Joseph Page Date: Fri, 20 Mar 2015 18:55:42 +0100 Subject: [PATCH] Windows : str.splitlines instead of str.split To be able to read `.dockerignore` file edited on Windows, python-py may use the multi-platform split function `str.splitlines()` Ref : https://docs.python.org/2/library/stdtypes.html#str.splitlines --- docker/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/client.py b/docker/client.py index 79726aafab..57c17cf875 100644 --- a/docker/client.py +++ b/docker/client.py @@ -322,7 +322,7 @@ def build(self, path=None, tag=None, quiet=False, fileobj=None, exclude = None if os.path.exists(dockerignore): with open(dockerignore, 'r') as f: - exclude = list(filter(bool, f.read().split('\n'))) + exclude = list(filter(bool, f.read().splitlines())) # These are handled by the docker daemon and should not be # excluded on the client if 'Dockerfile' in exclude: