Skip to content

Commit

Permalink
datetime.datetime.utcnow() is deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
Al-Azif committed Jan 8, 2024
1 parent f0bf02b commit 6e5e594
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions start.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
SETTINGS = None
MENU_OPEN = False
DEBUG_VAR = {}
SCRIPT_START = (datetime.datetime.utcnow()).strftime('%a, %d %b %Y %H:%M:%S GMT')
SCRIPT_START = (datetime.datetime.now(datetime.UTC)).strftime('%a, %d %b %Y %H:%M:%S GMT')


class ThreadedHTTPServer(ThreadingMixIn, HTTPServer):
Expand Down Expand Up @@ -522,7 +522,7 @@ def theme_loader(self):
try:
cookies = SimpleCookie(self.headers.get('Cookie'))

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)};"
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)};"
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>'
extra_headers = {}

Expand Down

0 comments on commit 6e5e594

Please sign in to comment.