question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Table.read segfaults on CSV file with missing comma in header

See original GitHub issue

For this CSV file with a missing trailing comma in the header line

aaa,bbb
1,2,
3,4,

I’m getting a segfault from Table.read:

$ python -c 'from astropy.table import Table; Table.read("test.csv")'
Segmentation fault: 11

This is with Python 3.5.2, Numpy 1.11.1 and Astropy 1.2 from Macports on latest Mac OS X.

Here’s the crash report: https://gist.github.com/cdeil/164d4d5ee14b49598e0454873ff0ea04#file-gistfile1-txt-L34

1   cparser.cpython-35m-darwin.so   0x0000000111448763 __pyx_pw_7astropy_2io_5ascii_7cparser_7CParser_9read + 1219

@mdmueller, @taldcroft or anyone familiar with the astropy.io.ascii cparser: can you reproduce or do you need more info?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

4reactions
saimncommented, Dec 1, 2016

Having a quick look to it, now that I know a bit the tokenizer code, it should be easy to fix. I will open a PR later.

0reactions
taldcroftcommented, Dec 1, 2016

#5219 is a duplicate of this and I’ve closed it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Column names out by one after read.csv (cause is trailing ...
The column headers are out by one. When I remove the commas in the second and third lines, i.e. import this file: "Sl.no", ......
Read more >
Intermittent segfaults with ascii loader · Issue #3691
The segfault occurs when attempting to read a big CSV file with the HTML reader (via libxml) during the guessing process. Maybe I'm...
Read more >
Solved: Display XY Data Will Not Show Table Headers
Attempting to Display XY Data shows field numbers and no table headers. I tried to export the csv table into a .dbf, but...
Read more >
Extract Rows from Excel CSV (No Table)
Hi all, I have a series of CSV files stored in a location in SharePoint — that have a title row (to ignore)...
Read more >
Handling Messy CSV Files
There's a very simple reason for this problem: a “comma separated value” file is not a standard file format, but is actually more...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found