Skip to content

!B [#7852] fix for _rrule maximum recursion depth exceeded on multiprocessing usage #7854

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

Merged
merged 5 commits into from
Jan 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/matplotlib/dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,8 @@ def set(self, **kwargs):
self._rrule = rrule(**self._construct)

def __getattr__(self, name):
if name in ['__getstate__', '__setstate__']:
return object.__getattr__(self, name)
if name in self.__dict__:
return self.__dict__[name]
return getattr(self._rrule, name)
Expand Down
10 changes: 10 additions & 0 deletions lib/matplotlib/tests/test_pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import numpy as np

from matplotlib.testing.decorators import cleanup, image_comparison
from matplotlib.dates import rrulewrapper
import matplotlib.pyplot as plt
import matplotlib.transforms as mtransforms

Expand Down Expand Up @@ -270,6 +271,15 @@ def test_transform():
assert_equal(obj.wrapper.output_dims, obj.composite.output_dims)


def test_rrulewrapper():
r = rrulewrapper(2)
try:
pickle.loads(pickle.dumps(r))
except RecursionError:
print('rrulewrapper pickling test failed')
raise


if __name__ == '__main__':
import nose
nose.runmodule(argv=['-s'])