diff --git a/ChangeLog.md b/ChangeLog.md index 8bab3370..ca780790 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1637,7 +1637,7 @@ updated to using Python 3.9.8. - When the new option is not active, the application will minimize to the taskbar as normal. -Bug Fixex +Bug Fixes --- * If a CAPI query failed in such a way that no `requests.Response` object diff --git a/companion.py b/companion.py index 384dcdd5..19f12a14 100644 --- a/companion.py +++ b/companion.py @@ -821,7 +821,7 @@ class Session: capi_data = CAPIData(capi_json, capi_host, capi_endpoint, monitor.cmdr) self.capi_raw_data.record_endpoint( capi_endpoint, r.content.decode(encoding='utf-8'), - datetime.datetime.utcnow() + datetime.datetime.now(datetime.timezone.utc) ) except requests.ConnectionError as e: diff --git a/monitor.py b/monitor.py index 91cf3375..3df0f85c 100644 --- a/monitor.py +++ b/monitor.py @@ -67,7 +67,7 @@ class EDLogs(FileSystemEventHandler): def __init__(self) -> None: # TODO(A_D): A bunch of these should be switched to default values (eg '' for strings) and no longer be Optional FileSystemEventHandler.__init__(self) # futureproofing - not need for current version of watchdog - self.root: 'tkinter.Tk' = None # type: ignore # Don't use Optional[] - mypy thinks no methods + self.root: tkinter.Tk = None # type: ignore # Don't use Optional[] - mypy thinks no methods self.currentdir: str | None = None # The actual logdir that we're monitoring self.logfile: str | None = None self.observer: BaseObserver | None = None @@ -188,7 +188,7 @@ class EDLogs(FileSystemEventHandler): }, } - def start(self, root: 'tkinter.Tk') -> bool: # noqa: CCR001 + def start(self, root: tkinter.Tk) -> bool: # noqa: CCR001 """ Start journal monitoring. diff --git a/util_ships.py b/util_ships.py index b2105106..8abbe20f 100644 --- a/util_ships.py +++ b/util_ships.py @@ -5,6 +5,7 @@ Copyright (c) EDCD, All Rights Reserved Licensed under the GNU General Public License. See LICENSE file. """ +import os from pathlib import Path from edmc_data import ship_name_map @@ -17,7 +18,7 @@ def ship_file_name(ship_name: str, ship_type: str) -> str: name = Path(name).with_suffix("").name # Check if the name is a reserved filename - if Path(name).is_reserved(): + if os.path.isreserved(name): name += "_" return name.translate(