FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix TypeError in parser's error-wrapping logic by eastface · Pull Request #987 · dateutil/dateutil · GitHub

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

Merged
pganssle merged 2 commits into
dateutil:masterfrom
eastface:issue_981
Jan 2, 2020
Merged

pganssle merged 2 commits into
dateutil:masterfrom
eastface:issue_981

Conversation

eastface commented Dec 23, 2019
edited
Loading

Copy link
Copy Markdown
Contributor

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 commented Jan 2, 2020

Copy link
Copy Markdown
Member

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

I'll rebase and merge this tonight or tomorrow.

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 commented Jan 2, 2020

Copy link
Copy Markdown
Member

@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 commented Jan 2, 2020

Copy link
Copy Markdown
Contributor Author

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 merged commit 21fe6e9 into dateutil:master Jan 2, 2020

pganssle commented Jan 2, 2020

Copy link
Copy Markdown
Member

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.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL