Visitar URL original
bpo-45239: Fix parsedate_tz when time has more than 2 dots in it by benhoyt · Pull Request #28452 · python/cpython · GitHub
The Wayback Machine - https://web.archive.org/web/20210922195654/https://github.com/python/cpython/pull/28452
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-45239: Fix parsedate_tz when time has more than 2 dots in it #28452

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

@benhoyt
Copy link
Contributor

@benhoyt benhoyt commented Sep 18, 2021 •

Fixes issue 45239: https://bugs.python.org/issue45239

More details in the issue, but here's the repro case:

$ python3.10 -c 'import email.utils; \
    email.utils.parsedate_tz("Wed, 3 Apr 2002 12.34.56.78+0800")'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.10/email/_parseaddr.py", line 50, in parsedate_tz
    res = _parsedate_tz(data)
  File "/usr/local/lib/python3.10/email/_parseaddr.py", line 134, in _parsedate_tz
    thh = int(thh)
UnboundLocalError: local variable 'thh' referenced before assignment

https://bugs.python.org/issue45239

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants