diff --git a/masque/file/gdsii.py b/masque/file/gdsii.py index 8b04bec..37b1a22 100644 --- a/masque/file/gdsii.py +++ b/masque/file/gdsii.py @@ -124,7 +124,7 @@ def writefile(patterns: List[Pattern] or Pattern, else: open_func = open - with open_func(path, mode='wb') as stream: + with io.BufferedWriter(open_func(path, mode='wb')) as stream: results = write(patterns, stream, *args, **kwargs) return results @@ -218,7 +218,7 @@ def readfile(filename: str or pathlib.Path, else: open_func = open - with open_func(path, mode='rb') as stream: + with io.BufferedReader(open_func(path, mode='rb')) as stream: results = read(stream, *args, **kwargs) return results