Skip to content

Commit 6e5e594

Browse files
committed
datetime.datetime.utcnow() is deprecated
1 parent f0bf02b commit 6e5e594

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

start.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
SETTINGS = None
6868
MENU_OPEN = False
6969
DEBUG_VAR = {}
70-
SCRIPT_START = (datetime.datetime.utcnow()).strftime('%a, %d %b %Y %H:%M:%S GMT')
70+
SCRIPT_START = (datetime.datetime.now(datetime.UTC)).strftime('%a, %d %b %Y %H:%M:%S GMT')
7171

7272

7373
class ThreadedHTTPServer(ThreadingMixIn, HTTPServer):
@@ -522,7 +522,7 @@ def theme_loader(self):
522522
try:
523523
cookies = SimpleCookie(self.headers.get('Cookie'))
524524

525-
default_cookie = f"theme={SETTINGS['Theme']}; expires={(datetime.datetime.utcnow() + datetime.timedelta(days=36500)).strftime('%a, %d %b %Y %H:%M:%S GMT')}; domain={self.headers.get('Host')}; path={quote(self.path)};"
525+
default_cookie = f"theme={SETTINGS['Theme']}; expires={(datetime.datetime.now(datetime.UTC) + datetime.timedelta(days=36500)).strftime('%a, %d %b %Y %H:%M:%S GMT')}; domain={self.headers.get('Host')}; path={quote(self.path)};"
526526
theme_error_html = b'<!DOCTYPE html><html><head><meta charset="utf-8"><title>Theme Error</title></head><body><script>"use strict";window.addEventListener("load",function(){alert("Error retrieving theme data, resetting theme to default and reloading."),window.location.reload(!0)});</script></body></html>'
527527
extra_headers = {}
528528

0 commit comments

Comments
 (0)