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

Catch correct parse errror type for dateutil >= 2.8.1 #15729

Merged
merged 1 commit into from
Nov 21, 2019

Conversation

timhoffm
Copy link
Member

@timhoffm timhoffm commented Nov 19, 2019

PR Summary

Fixes #15726.

Backporting to 2.2.5 because dateutil 2.8.1 still supports Python 2.

Release critical because this execption is part of a standard code path (_str_is_convertible() returning False).

@timhoffm timhoffm added topic: date handling Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. labels Nov 19, 2019
@timhoffm timhoffm added this to the v2.2.5 milestone Nov 19, 2019
@anntzer
Copy link
Contributor

anntzer commented Nov 19, 2019

That looks like a bug in dateutil? (the exception is raised while trying to format the message for the actual exception...) Let's see whether @pganssle plans to fix that soon, if there's an (e.g.) 2.8.1.1 that fixes it perhaps we can just not support 2.8.1.

@pganssle
Copy link
Member

I don't think this has been reported, do you have any details about how to trigger this?

@anntzer
Copy link
Contributor

anntzer commented Nov 19, 2019

traceback is at #15726, sorry I don't have a minimal repro but the last line of the tb is

~/anaconda3/envs/pylandstats/lib/python3.6/site-packages/dateutil/parser/_parser.py in parse(self, timestr, default, ignoretz, tzinfos, **kwargs)
    655             ret = self._build_naive(res, default)
    656         except ValueError as e:
--> 657             six.raise_from(ParserError(e.args[0] + ": %s", timestr), e)
    658 
    659         if not ignoretz:

TypeError: unsupported operand type(s) for +: 'int' and 'str'

@pganssle
Copy link
Member

Created an issue in dateutil/dateutil#981.

Shouldn't be too tough to fix it.

@story645 story645 merged commit 026dacd into matplotlib:master Nov 21, 2019
@lumberbot-app
Copy link

lumberbot-app bot commented Nov 21, 2019

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
$ git checkout v2.2.x
$ git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
$ git cherry-pick -m1 026dacd2cb90dc6b2cf17a8edafda213f51cb7c6
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
$ git commit -am 'Backport PR #15729: Catch correct parse errror type for dateutil >= 2.8.1'
  1. Push to a named branch :
git push YOURFORK v2.2.x:auto-backport-of-pr-15729-on-v2.2.x
  1. Create a PR against branch v2.2.x, I would have named this PR:

"Backport PR #15729 on branch v2.2.x"

And apply the correct labels and milestones.

Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon!

If these instruction are inaccurate, feel free to suggest an improvement.

meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Nov 21, 2019
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Nov 21, 2019
timhoffm added a commit that referenced this pull request Nov 21, 2019
…729-on-v3.2.x

Backport PR #15729 on branch v3.2.x (Catch correct parse errror type for dateutil >= 2.8.1)
timhoffm added a commit that referenced this pull request Nov 21, 2019
…729-on-v3.1.x

Backport PR #15729 on branch v3.1.x (Catch correct parse errror type for dateutil >= 2.8.1)
@timhoffm
Copy link
Member Author

Doesn't need backport to 2.2.x because that code path did not exist there yet.

@timhoffm timhoffm deleted the dateutil-error branch November 24, 2019 10:50
@QuLogic QuLogic modified the milestones: v2.2.5, v3.1.3 Nov 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. topic: date handling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dateutil 2.8.1 raises TypeError instead of ValueError
6 participants