1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-25 17:36:13 +01:00

connection: Fix traceback on loading an invalid cookiejar file

Ignore the error and overwrite the cookiejar file with new content
after we get a new cookie from server.
This commit is contained in:
Daniel Mach 2023-02-02 11:00:41 +01:00
parent 18f4d88231
commit efa2c09e2e

View File

@ -451,7 +451,10 @@ class CookieJarAuthHandler(AuthHandlerBase):
pass
jar = http.cookiejar.LWPCookieJar(self.cookiejar_path)
if os.path.isfile(self.cookiejar_path):
try:
jar.load()
except http.cookiejar.LoadError:
pass
self.COOKIEJARS[self.cookiejar_path] = jar
return jar