Skip to content

Conversation

Mosh333
Copy link

@Mosh333 Mosh333 commented Nov 22, 2022

Added ValueError error handling for cookiejar.py. Bug ticket raised forced a ValueError by attempting to load an empty MozillaCookieJar object. This caused an error in line 2041, where it attempted to unpack and assign 1 value to 7 values.

Added ValueError error handling for cookiejar.py. Bug ticket raised forced a ValueError by attempting to load an empty MozillaCookieJar object. This caused an error in line 2041, where it attempted to unpack and assign 1 value to 7 values.
@bedevere-bot
Copy link

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

@ghost
Copy link

ghost commented Nov 22, 2022

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-bot
Copy link

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

@Mosh333
Copy link
Author

Mosh333 commented Nov 22, 2022

Sample code output for proposed change:

$ ./python.exe cookiesReproTest.py; echo "Version used: $(./python.exe -V)"
Traceback (most recent call last):
  File "/Users/namehere/Documents/GitHub/cpython_issue99453/cookiesReproTest.py", line 17, in <module>
    jar.load()
  File "/Users/namehere/Documents/GitHub/cpython_issue99453/Lib/http/cookiejar.py", line 1802, in load
    self._really_load(f, filename, ignore_discard, ignore_expires)
  File "/Users/namehere/Documents/GitHub/cpython_issue99453/Lib/http/cookiejar.py", line 2041, in _really_load
    domain, domain_specified, path, secure, expires, name, value = \
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected 7, got 1)
Version used: Python 3.12.0a2+

cookiesReproTest.py is the script that was shared in the original bug ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants