Skip to content

Commit bd60865

Browse files
committed
BUG: try to work around mingw32 segfault in #1898
1 parent f553668 commit bd60865

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

RELEASE.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ pandas 0.9.0
4646
- Add args/kwds options to Series.apply (#1829)
4747
- Add inplace option to Series/DataFrame.reset_index (#1797)
4848
- Add quoting option for DataFrame.to_csv (#1902)
49+
- Indicate long column value truncation in DataFrame output with ... (#1854)
4950

5051
**API Changes**
5152

pandas/src/hashtable.pyx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,15 @@ cdef class ObjectVector:
6565
# Create a 1D array, of length 'size'
6666
result = PyArray_SimpleNewFromData(1, shape,
6767
np.NPY_OBJECT, self.vec.a)
68-
if xfer_data:
69-
self.owndata = 0
70-
util.set_array_owndata(result)
7168

72-
return result
69+
# urgh, mingw32 barfs because of this
70+
71+
# if xfer_data:
72+
# self.owndata = 0
73+
# util.set_array_owndata(result)
74+
# return result
7375

76+
return result.copy()
7477

7578
cdef inline append(self, object o):
7679
kv_object_push(&self.vec, <PyObject*> o)

pandas/tests/test_algos.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ def test_objects(self):
4141
result = algos.unique(arr)
4242
self.assert_(isinstance(result, np.ndarray))
4343

44+
def test_object_refcount_bug(self):
45+
lst = ['A', 'B', 'C', 'D', 'E']
46+
for i in xrange(1000):
47+
len(algos.unique(lst))
4448

4549
def test_quantile():
4650
s = Series(np.random.randn(100))

0 commit comments

Comments
 (0)