diff --git a/mdciao/pdb/pdb.py b/mdciao/pdb/pdb.py index 6ea39cbe..9a00d105 100644 --- a/mdciao/pdb/pdb.py +++ b/mdciao/pdb/pdb.py @@ -24,7 +24,7 @@ from mdtraj import load_pdb as _load_pdb from tempfile import NamedTemporaryFile as _NamedTemporaryFile -from shutil import copy as _copy, copyfileobj as _copyfileobj +from shutil import copy as _copy, copyfileobj as _copyfileobj, COPY_BUFSIZE as _COPY_BUFSIZE from urllib.error import HTTPError as _HTTPError, URLError as _URLError from urllib.request import urlopen as _urlopen @@ -135,7 +135,7 @@ def pdb2traj(code, with _urlopen(url1) as response: if response.status == 200: with _NamedTemporaryFile(delete=True) as tmp_file: - _copyfileobj(response, tmp_file) + _copyfileobj(response, tmp_file, length=_COPY_BUFSIZE*2) geom = _load_pdb(tmp_file.name) if filename is not None: print_v("Saving to %s..." % filename, end="", flush=True)