numpy/numpy — pull request #300 by thouis (2012-06-08 12:38:27+00:00)
Title: BUG: missing incref for metadata of datetime dtypes.

I'm fairly certain that this is the cause of some sporadic crashes I'm experiencing working on allocation tracking for numpy.

The bug can also be seen by building and running numpy under a python configured with --with-debug, which results in this crash when running nose.test(verbose=2):

```
[.....]
test_divisor_conversion_year (test_datetime.TestDateTime) ... ok
test_dtype_comparison (test_datetime.TestDateTime) ... ok
test_dtype_promotion (test_datetime.TestDateTime) ... ok
test_hours (test_datetime.TestDateTime) ... ok
test_month_truncation (test_datetime.TestDateTime) ... ok
test_pickle (test_datetime.TestDateTime) ... Fatal Python error: numpy/core/src/multiarray/descriptor.c:1564 object at 0x102a36010 has negative ref count -1
Abort trap
```

This is on OSX 10.6.8

```Python 2.7.3 (default, Jun 8 2012, 11:47:57)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
[147717 refs]
>>> numpy.version.version
'1.7.0.dev-5013093'
[147719 refs]
```
(the refs lines are from the --with-debug)