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:
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user