pyreadstat icon indicating copy to clipboard operation
pyreadstat copied to clipboard

possible bug - Getting exit code -1073741819 (0xC0000005) when trying to read stata file

Open cmachingauta opened this issue 3 years ago • 1 comments

Please read the README, particularly the known limitations section! Done

Describe the issue Hi @ofajardo, I am getting code: Process finished with exit code -1073741819 (0xC0000005) when I try to read in the particular stata file attached. No issue with SPSS or other stata files. Just this one. I have used pyreadstat multiple times but just ran into this issue today.

To Reproduce Steps to reproduce the behavior.

import pyreadstat df=pyreadstat.read_dta("stata_example_not_loading.dta") print(df)

Result: Process finished with exit code -1073741819 (0xC0000005) Expected result: (from reading the spss version of the file): ( hhid child_id ... s4_chldcrhrs_outsidemmbrs__77 provided_chldcr_ 0 465.0 1.0 ... NaN NaN 1 4073.0 1.0 ... NaN NaN 2 2212.0 8.0 ... NaN NaN 3 1377.0 2.0 ... NaN NaN 4 7278.0 3.0 ... NaN NaN 5 5263.0 5.0 ... NaN 0.0 6 366.0 3.0 ... NaN NaN 7 1714.0 2.0 ... NaN NaN 8 1509.0 1.0 ... NaN NaN 9 1677.0 1.0 ... NaN 0.0

[10 rows x 220 columns], <pyreadstat._readstat_parser.metadata_container object at 0x000001FE3D1D8130>) Process finished with exit code 0

Another stata file reads fine: df=pyreadstat.read_dta("stata_example_that_works.dta") print(df) ( hhid wave ... s12_q6_surveylang__77 s12_q7_comprehension 0 6861.0 2.0 ... 0 1 1 6607.0 4.0 ... 0 1 2 2395.0 8.0 ... 0 1 3 7974.0 3.0 ... 0 1 [4 rows x 2410 columns], <pyreadstat._readstat_parser.metadata_container object at 0x00000262C2A63FD0>) Process finished with exit code 0

File example: Please see attached examples.zip. Both stata files saved in Stata17

Expected behavior I expect pyreadstat to read "stata_example_not_loading.dta" the same way it reads "stata_example_that_works.dta" The spss version of the file reads without a problem (also included as ch_data.sav).

Setup Information: pyreadstat installed using pip Platform: Windows 10, 64-bit operating system, x64-based processor Python Version 3.9 Python Distribution (System, plain python, Anaconda) - plain python Virtualenv in Pycharm IDE

cmachingauta avatar Aug 26 '22 19:08 cmachingauta

files below examples.zip

cmachingauta avatar Aug 26 '22 19:08 cmachingauta

Thanks for the reproducible example, I can reproduce the issue on linux. I will investigate the root cause.

ofajardo avatar Sep 24 '22 12:09 ofajardo

solved in version 1.2.0

ofajardo avatar Oct 25 '22 06:10 ofajardo

Thank you for fixing.

cmachingauta avatar Nov 21 '22 16:11 cmachingauta