Skip to content

Segfault when passing a mock.Mock instance to pandas.read_csv (it was an accident!) #15337

Closed
@erewok

Description

@erewok

Code Sample

In [1]: import pandas as pd

In [2]: from unittest import mock

In [3]: pd.read_csv(mock.Mock())
zsh: segmentation fault  ipython

Problem description

I wrote a test where I accidentally ended up passing a mock.Mock object into pandas.read_csv and it segfaults.

Expected Output

Well, it would nice if it threw an error telling me that I screwed up, instead of segfaulting.

Output of pd.show_versions()

In [6]: pd.show_versions()

INSTALLED VERSIONS

commit: None
python: 3.5.1.final.0
python-bits: 64
OS: Darwin
OS-release: 16.3.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8

pandas: 0.18.0
nose: None
pip: 9.0.1
setuptools: 24.0.2
Cython: 0.24.1
numpy: 1.10.4
scipy: None
statsmodels: None
xarray: None
IPython: 5.1.0
sphinx: None
patsy: None
dateutil: 2.5.3
pytz: 2016.4
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: None
openpyxl: None
xlrd: 1.0.0
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.9
pymysql: None
psycopg2: 2.6.1 (dt dec pq3 ext)
jinja2: 2.8
boto: None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Compatpandas objects compatability with Numpy or Python functionsIO CSVread_csv, to_csv

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions