From 777ca5c3698940e6147054d6728dfb38937037f9 Mon Sep 17 00:00:00 2001 From: Not Committed Yet Date: Sat, 30 Mar 2024 20:00:00 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20fix=20stuff?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- an_website/update/update.py | 7 +++---- pip-constraints.txt | 2 +- pip-dev-requirements.txt | 2 +- pip-requirements.txt | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/an_website/update/update.py b/an_website/update/update.py index 007265f7a..98f83bc0a 100644 --- a/an_website/update/update.py +++ b/an_website/update/update.py @@ -16,14 +16,13 @@ from __future__ import annotations import asyncio -import io import logging import os import sys from asyncio import Future from queue import SimpleQueue from tempfile import NamedTemporaryFile, TemporaryDirectory -from typing import TYPE_CHECKING, Any, ClassVar, Final +from typing import TYPE_CHECKING, IO, Any, ClassVar, Final from urllib.parse import unquote from tornado.web import stream_request_body @@ -50,11 +49,10 @@ def get_module_info() -> ModuleInfo: ) -def write_from_queue(file: io.IOBase, queue: SimpleQueue[None | bytes]) -> None: +def write_from_queue(file: IO[bytes], queue: SimpleQueue[None | bytes]) -> None: """Read from a queue and write to a file.""" while True: # pylint: disable=while-used if (chunk := queue.get()) is None: - file.close() break file.write(chunk) @@ -116,6 +114,7 @@ async def put(self, filename: str) -> None: """Handle PUT requests to the update API.""" self.queue.put(None) await self.future + self.file.close() filepath = os.path.join(self.dir.name, unquote(filename)) os.rename(self.file.name, filepath) diff --git a/pip-constraints.txt b/pip-constraints.txt index fcf535aef..4748cc793 100644 --- a/pip-constraints.txt +++ b/pip-constraints.txt @@ -139,7 +139,7 @@ pillow==10.2.0 pillow-jxl-plugin==1.1.0.post1 pycares==4.4.0 pycryptodome==3.20.0 -pycurl==7.45.3 +pycurl==7.45.2 pyjwt==2.8.0 pysocks==1.7.1 python-geoip-geolite2-yplan==2019.1224 diff --git a/pip-dev-requirements.txt b/pip-dev-requirements.txt index 7a00ef210..3fd5e60a1 100644 --- a/pip-dev-requirements.txt +++ b/pip-dev-requirements.txt @@ -139,7 +139,7 @@ pillow==10.2.0; python_version >= '3.8' pillow-jxl-plugin==1.1.0.post1; python_version >= '3.8' pycares==4.4.0; python_version >= '3.8' pycryptodome==3.20.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' -pycurl==7.45.3; python_version >= '3.5' +pycurl==7.45.2; python_version >= '3.5' pyjwt==2.8.0; python_version >= '3.7' pysocks==1.7.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' python-geoip-geolite2-yplan==2019.1224 diff --git a/pip-requirements.txt b/pip-requirements.txt index 719b79fa2..65ae60827 100644 --- a/pip-requirements.txt +++ b/pip-requirements.txt @@ -40,7 +40,7 @@ pillow-jxl-plugin==1.1.0.post1; python_version >= '3.8' pycares==4.4.0; python_version >= '3.8' pycparser==2.21 pycryptodome==3.20.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' -pycurl==7.45.3; python_version >= '3.5' +pycurl==7.45.2; python_version >= '3.5' pyjwt==2.8.0; python_version >= '3.7' pysocks==1.7.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' python-dateutil==2.8.2; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'