Passing an empty list to read_csv causes segmentation fault · Issue #45957 · pandas-dev/pandas (original) (raw)
Create a virtual environment with python 3.8.9 (same behaviour in 3.9.1 also). Install pandas using pip install pandas
. Run pd.read_csv([])
after importing pandas.
python Python 3.8.9 (default, Aug 21 2021, 15:53:23) [Clang 13.0.0 (clang-1300.0.29.3)] on darwin Type "help", "copyright", "credits" or "license" for more information. import pandas as pd pd.read_csv([]) fish: Job 1, 'python' terminated by signal SIGSEGV (Address boundary error)
Throw and error and exit gracefully. Currently, the python process is crashing.
numpy==1.22.2
pandas==1.4.0
python-dateutil==2.8.2
pytz==2021.3
six==1.16.0
Running pd.show_versions()
throws the following error, probably related to #44980
>>> import pandas as pd
>>> pd.show_versions()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/santhisenan/.local/share/virtualenvs/pd_versions-uc_eBlwP/lib/python3.9/site-packages/pandas/util/_print_versions.py", line 109, in show_versions
deps = _get_dependency_info()
File "/Users/santhisenan/.local/share/virtualenvs/pd_versions-uc_eBlwP/lib/python3.9/site-packages/pandas/util/_print_versions.py", line 88, in _get_dependency_info
mod = import_optional_dependency(modname, errors="ignore")
File "/Users/santhisenan/.local/share/virtualenvs/pd_versions-uc_eBlwP/lib/python3.9/site-packages/pandas/compat/_optional.py", line 126, in import_optional_dependency
module = importlib.import_module(name)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 790, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/Users/santhisenan/.local/share/virtualenvs/pd_versions-uc_eBlwP/lib/python3.9/site-packages/setuptools/__init__.py", line 8, in <module>
import _distutils_hack.override # noqa: F401
File "/Users/santhisenan/.local/share/virtualenvs/pd_versions-uc_eBlwP/lib/python3.9/site-packages/_distutils_hack/override.py", line 1, in <module>
__import__('_distutils_hack').do_override()
File "/Users/santhisenan/.local/share/virtualenvs/pd_versions-uc_eBlwP/lib/python3.9/site-packages/_distutils_hack/__init__.py", line 71, in do_override
ensure_local_distutils()
File "/Users/santhisenan/.local/share/virtualenvs/pd_versions-uc_eBlwP/lib/python3.9/site-packages/_distutils_hack/__init__.py", line 59, in ensure_local_distutils
assert '_distutils' in core.__file__, core.__file__
AssertionError: /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/core.py