crsmithdev/arrow — pull request #62 by yoloseem (2013-10-18 04:18:55+00:00)
Title: Fix a bug that Arrow object cannot be loaded from pickled object.

Hi.

Current implementation of `Arrow.__getattr__` causes an infinite recursion when trying unpickling of pickled arrow instance. So I added a test case for that and fixed `__getattr__` method to work as expected.

```pytb
Traceback (most recent call last):
File "/Users/khj/works/arrow/local/lib/python2.7/site-packages/chai/chai.py", line 57, in wrapper
func(self, *args, **kwargs)
File "/Users/khj/works/arrow/tests/arrow_tests.py", line 402, in test_pickle_and_unpickle
unpickled = pickle.loads(pickled)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 1382, in loads
return Unpickler(file).load()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 858, in load
dispatch[key](self)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 1215, in load_build
setstate = getattr(inst, "__setstate__", None)
File "/Users/khj/works/arrow/arrow/arrow.py", line 301, in __getattr__
value = getattr(self._datetime, name, None)
File "/Users/khj/works/arrow/arrow/arrow.py", line 301, in __getattr__
value = getattr(self._datetime, name, None)
File "/Users/khj/works/arrow/arrow/arrow.py", line 301, in __getattr__
value = getattr(self._datetime, name, None)
...
RuntimeError: maximum recursion depth exceeded
```