prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Impossible login to GOG.com: invalid cookie ?
  **Describe the bug**
  
  I can't connect Lutris with my GOG.com account: the GOG.com credentials window is here, I can fill it, but when I confirm this form, the window closes and… nothing more. My account isn't connected, and if I close the "Import games" window, I can't reopen it unless I delete '.cache/lutris' directory. 
  
  **Expected behavior**
  
  I should have a second GOG.com form asking for a PIN code, then my account should be connected in Lutris.
  
  **Current behavior**
  
  As in description above. Plus technical details:
  
  * two files are created  in '~/.cache/lutris/': .gog.auth and .gog.token (attached as [gog.auth.txt](https://github.com/lutris/lutris/files/4309081/gog.auth.txt) and [gog.token.txt](https://github.com/lutris/lutris/files/4309083/gog.token.txt))
  * according to standard output in terminal, some problems with Python, ending with an invalid cookie? (see [lutris.txt](https://github.com/lutris/lutris/files/4309117/lutris.txt))
  
  **Steps to reproduce**
  
  It happens while importing GOG games from the app or installing GOG games from the website.
  
  **System information**
  
  Fresh Lutris install, Arch Linux, kernel 5.5.8. More in [lutris.log](https://github.com/lutris/lutris/files/4309125/lutris.log)
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `lutris/util/cookies.py`
  Content:
  ```
  1 import time
  2 from http.cookiejar import MozillaCookieJar, Cookie, _warn_unhandled_exception
  3 
  4 
  5 class WebkitCookieJar(MozillaCookieJar):
  6     """Subclass of MozillaCookieJar for compatibility with cookies
  7     coming from Webkit2.
  8     This disables the magic_re header which is not present and adds
  9     compatibility with HttpOnly cookies (See http://bugs.python.org/issue2190)
  10     """
  11 
  12     def _really_load(self, f, filename, ignore_discard, ignore_expires):
  13         now = time.time()
  14         try:
  15             while 1:
  16                 line = f.readline()
  17                 if line == "":
  18                     break
  19 
  20                 # last field may be absent, so keep any trailing tab
  21                 if line.endswith("\n"):
  22                     line = line[:-1]
  23 
  24                 sline = line.strip()
  25                 # support HttpOnly cookies (as stored by curl or old Firefox).
  26                 if sline.startswith("#HttpOnly_"):
  27                     line = sline[10:]
  28                 elif sline.startswith("#") or sline == "":
  29                     continue
  30 
  31                 domain, domain_specified, path, secure, expires, name, value = line.split(
  32                     "\t"
  33                 )
  34                 secure = secure == "TRUE"
  35                 domain_specified = domain_specified == "TRUE"
  36                 if name == "":
  37                     # cookies.txt regards 'Set-Cookie: foo' as a cookie
  38                     # with no name, whereas http.cookiejar regards it as a
  39                     # cookie with no value.
  40                     name = value
  41                     value = None
  42 
  43                 initial_dot = domain.startswith(".")
  44                 assert domain_specified == initial_dot
  45 
  46                 discard = False
  47                 if expires == "":
  48                     expires = None
  49                     discard = True
  50 
  51                 # assume path_specified is false
  52                 c = Cookie(
  53                     0,
  54                     name,
  55                     value,
  56                     None,
  57                     False,
  58                     domain,
  59                     domain_specified,
  60                     initial_dot,
  61                     path,
  62                     False,
  63                     secure,
  64                     expires,
  65                     discard,
  66                     None,
  67                     None,
  68                     {},
  69                 )
  70                 if not ignore_discard and c.discard:
  71                     continue
  72                 if not ignore_expires and c.is_expired(now):
  73                     continue
  74                 self.set_cookie(c)
  75 
  76         except OSError:
  77             raise
  78         except Exception:
  79             _warn_unhandled_exception()
  80             raise OSError(
  81                 "invalid Netscape format cookies file %r: %r" % (filename, line)
  82             )
  83
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/lutris/util/cookies.py b/lutris/util/cookies.py
  --- a/lutris/util/cookies.py
  +++ b/lutris/util/cookies.py
  @@ -28,7 +28,7 @@
                   elif sline.startswith("#") or sline == "":
                       continue
   
  -                domain, domain_specified, path, secure, expires, name, value = line.split(
  +                domain, domain_specified, path, secure, expires, name, value, aditional_info = line.split(
                       "\t"
                   )
                   secure = secure == "TRUE"
  
verification_info: {"golden_diff": "diff --git a/lutris/util/cookies.py b/lutris/util/cookies.py\n--- a/lutris/util/cookies.py\n+++ b/lutris/util/cookies.py\n@@ -28,7 +28,7 @@\n                 elif sline.startswith(\"#\") or sline == \"\":\n                     continue\n \n-                domain, domain_specified, path, secure, expires, name, value = line.split(\n+                domain, domain_specified, path, secure, expires, name, value, aditional_info = line.split(\n                     \"\\t\"\n                 )\n                 secure = secure == \"TRUE\"\n", "issue": "Impossible login to GOG.com: invalid cookie ?\n**Describe the bug**\r\n\r\nI can't connect Lutris with my GOG.com account: the GOG.com credentials window is here, I can fill it, but when I confirm this form, the window closes and\u2026 nothing more. My account isn't connected, and if I close the \"Import games\" window, I can't reopen it unless I delete '.cache/lutris' directory. \r\n\r\n**Expected behavior**\r\n\r\nI should have a second GOG.com form asking for a PIN code, then my account should be connected in Lutris.\r\n\r\n**Current behavior**\r\n\r\nAs in description above. Plus technical details:\r\n\r\n* two files are created  in '~/.cache/lutris/': .gog.auth and .gog.token (attached as [gog.auth.txt](https://github.com/lutris/lutris/files/4309081/gog.auth.txt) and [gog.token.txt](https://github.com/lutris/lutris/files/4309083/gog.token.txt))\r\n* according to standard output in terminal, some problems with Python, ending with an invalid cookie? (see [lutris.txt](https://github.com/lutris/lutris/files/4309117/lutris.txt))\r\n\r\n**Steps to reproduce**\r\n\r\nIt happens while importing GOG games from the app or installing GOG games from the website.\r\n\r\n**System information**\r\n\r\nFresh Lutris install, Arch Linux, kernel 5.5.8. More in [lutris.log](https://github.com/lutris/lutris/files/4309125/lutris.log)\n", "before_files": [{"content": "import time\nfrom http.cookiejar import MozillaCookieJar, Cookie, _warn_unhandled_exception\n\n\nclass WebkitCookieJar(MozillaCookieJar):\n    \"\"\"Subclass of MozillaCookieJar for compatibility with cookies\n    coming from Webkit2.\n    This disables the magic_re header which is not present and adds\n    compatibility with HttpOnly cookies (See http://bugs.python.org/issue2190)\n    \"\"\"\n\n    def _really_load(self, f, filename, ignore_discard, ignore_expires):\n        now = time.time()\n        try:\n            while 1:\n                line = f.readline()\n                if line == \"\":\n                    break\n\n                # last field may be absent, so keep any trailing tab\n                if line.endswith(\"\\n\"):\n                    line = line[:-1]\n\n                sline = line.strip()\n                # support HttpOnly cookies (as stored by curl or old Firefox).\n                if sline.startswith(\"#HttpOnly_\"):\n                    line = sline[10:]\n                elif sline.startswith(\"#\") or sline == \"\":\n                    continue\n\n                domain, domain_specified, path, secure, expires, name, value = line.split(\n                    \"\\t\"\n                )\n                secure = secure == \"TRUE\"\n                domain_specified = domain_specified == \"TRUE\"\n                if name == \"\":\n                    # cookies.txt regards 'Set-Cookie: foo' as a cookie\n                    # with no name, whereas http.cookiejar regards it as a\n                    # cookie with no value.\n                    name = value\n                    value = None\n\n                initial_dot = domain.startswith(\".\")\n                assert domain_specified == initial_dot\n\n                discard = False\n                if expires == \"\":\n                    expires = None\n                    discard = True\n\n                # assume path_specified is false\n                c = Cookie(\n                    0,\n                    name,\n                    value,\n                    None,\n                    False,\n                    domain,\n                    domain_specified,\n                    initial_dot,\n                    path,\n                    False,\n                    secure,\n                    expires,\n                    discard,\n                    None,\n                    None,\n                    {},\n                )\n                if not ignore_discard and c.discard:\n                    continue\n                if not ignore_expires and c.is_expired(now):\n                    continue\n                self.set_cookie(c)\n\n        except OSError:\n            raise\n        except Exception:\n            _warn_unhandled_exception()\n            raise OSError(\n                \"invalid Netscape format cookies file %r: %r\" % (filename, line)\n            )\n", "path": "lutris/util/cookies.py"}], "after_files": [{"content": "import time\nfrom http.cookiejar import MozillaCookieJar, Cookie, _warn_unhandled_exception\n\n\nclass WebkitCookieJar(MozillaCookieJar):\n    \"\"\"Subclass of MozillaCookieJar for compatibility with cookies\n    coming from Webkit2.\n    This disables the magic_re header which is not present and adds\n    compatibility with HttpOnly cookies (See http://bugs.python.org/issue2190)\n    \"\"\"\n\n    def _really_load(self, f, filename, ignore_discard, ignore_expires):\n        now = time.time()\n        try:\n            while 1:\n                line = f.readline()\n                if line == \"\":\n                    break\n\n                # last field may be absent, so keep any trailing tab\n                if line.endswith(\"\\n\"):\n                    line = line[:-1]\n\n                sline = line.strip()\n                # support HttpOnly cookies (as stored by curl or old Firefox).\n                if sline.startswith(\"#HttpOnly_\"):\n                    line = sline[10:]\n                elif sline.startswith(\"#\") or sline == \"\":\n                    continue\n\n                domain, domain_specified, path, secure, expires, name, value, aditional_info = line.split(\n                    \"\\t\"\n                )\n                secure = secure == \"TRUE\"\n                domain_specified = domain_specified == \"TRUE\"\n                if name == \"\":\n                    # cookies.txt regards 'Set-Cookie: foo' as a cookie\n                    # with no name, whereas http.cookiejar regards it as a\n                    # cookie with no value.\n                    name = value\n                    value = None\n\n                initial_dot = domain.startswith(\".\")\n                assert domain_specified == initial_dot\n\n                discard = False\n                if expires == \"\":\n                    expires = None\n                    discard = True\n\n                # assume path_specified is false\n                c = Cookie(\n                    0,\n                    name,\n                    value,\n                    None,\n                    False,\n                    domain,\n                    domain_specified,\n                    initial_dot,\n                    path,\n                    False,\n                    secure,\n                    expires,\n                    discard,\n                    None,\n                    None,\n                    {},\n                )\n                if not ignore_discard and c.discard:\n                    continue\n                if not ignore_expires and c.is_expired(now):\n                    continue\n                self.set_cookie(c)\n\n        except OSError:\n            raise\n        except Exception:\n            _warn_unhandled_exception()\n            raise OSError(\n                \"invalid Netscape format cookies file %r: %r\" % (filename, line)\n            )\n", "path": "lutris/util/cookies.py"}]}