diff --git a/pypiserver/backend.py b/pypiserver/backend.py index 4119f8c..887dabd 100644 --- a/pypiserver/backend.py +++ b/pypiserver/backend.py @@ -204,7 +204,7 @@ def write_file(fh: t.BinaryIO, destination: PathLike) -> None: """write a byte stream into a destination file. Writes are chunked to reduce the memory footprint """ - chunk_size = 2 ** 20 # 1 MB + chunk_size = 2**20 # 1 MB offset = fh.tell() try: with open(destination, "wb") as dest: @@ -259,7 +259,7 @@ def digest_file(file_path: PathLike, hash_algo: str) -> str: From http://stackoverflow.com/a/21565932/548792 """ - blocksize = 2 ** 16 + blocksize = 2**16 digester = hashlib.new(hash_algo) with open(file_path, "rb") as f: for block in iter(lambda: f.read(blocksize), b""): diff --git a/tests/test_server.py b/tests/test_server.py index cef95c8..18119ca 100644 --- a/tests/test_server.py +++ b/tests/test_server.py @@ -57,7 +57,7 @@ def run_server(root, authed=False, other_cli=""): f"run -vvv --overwrite -i 127.0.0.1 " f"-p {port} {pswd_opts} {other_cli} {root}" ) - proc = Popen(cmd.split(), bufsize=2 ** 16) + proc = Popen(cmd.split(), bufsize=2**16) srv = Srv(port, root) try: wait_until_ready(srv)