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

Fix TypeError in parser's error-wrapping logic #987

Merged
merged 2 commits into from Jan 2, 2020

Conversation

eastface
Copy link
Contributor

@eastface eastface commented Dec 23, 2019

Summary of changes

Guard against an integer value in ValueError args. This is known to occur with IllegalMonthError.

Closes #981

Pull Request Checklist

  • Changes have tests
  • Authors have been added to AUTHORS.md
  • News fragment added in changelog.d. See CONTRIBUTING.md for details

@pganssle
Copy link
Member

pganssle commented Jan 2, 2020

Thanks for this @eastface, it looks great to me. The appveyor failure seems unrelated.

I'll rebase and merge this tonight or tomorrow.

@pganssle pganssle changed the title Fixed gh issue #981 - Added regression test and fixed as suggested. Fix TypeError in parser's error-wrapping logic Jan 2, 2020
@pganssle
Copy link
Member

pganssle commented Jan 2, 2020

@eastface I have reworded the changelog message a bit, please take a look and let me know if you find it acceptable. If so I'll squash it into your original commit and merge.

Thanks again for your contribution!

@eastface
Copy link
Contributor Author

eastface commented Jan 2, 2020

Yes, no problems with that. Glad I was able to help.

eastface and others added 2 commits January 2, 2020 12:36
In attempting to pass-through the string representation of an exception
we are wrapping, we made the erroneous assumption that `args[0]` would
always be a string (or something that can concatenate cleanly with a
string). This turns out not to be the case with `IllegalMonthError`,
where it is an integer, so to avoid raising an erroneous `TypeError`, we
first convert the wrapped exception to a string.

See GH issue dateutil#981.
@pganssle pganssle merged commit 21fe6e9 into dateutil:master Jan 2, 2020
@pganssle
Copy link
Member

pganssle commented Jan 2, 2020

Thanks again @eastface.

There are a few more bugfixes I'd like to get merged, but we can cut a 2.8.2 release soon-ish.

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.

parser raises TypeError in wrapper logic
2 participants