1
0

fix some DeprecationWarnings in python3.12

...\electrum\electrum\logging.py:137: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
...\electrum\electrum\x509.py:310: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
This commit is contained in:
SomberNight
2023-12-24 08:57:57 +00:00
parent 3d1009f7e2
commit d54184dbc1
4 changed files with 14 additions and 11 deletions

View File

@@ -134,7 +134,7 @@ def _configure_file_logging(log_directory: pathlib.Path, *, num_files_keep: int)
_delete_old_logs(log_directory, num_files_keep=num_files_keep)
timestamp = datetime.datetime.utcnow().strftime("%Y%m%dT%H%M%SZ")
timestamp = datetime.datetime.now(datetime.timezone.utc).strftime("%Y%m%dT%H%M%SZ")
PID = os.getpid()
_logfile_path = log_directory / f"electrum_log_{timestamp}_{PID}.log"