Skip to content

Conversation

@taldcroft
Copy link
Member

A table like below (spaces added for clarity) was failing in the fast tab reader on Windows. This is related to the \r\n line endings:

a \t b
1 \t
2 \t 3

This PR changes the way the fast reader handles Windows CRLF line endings by effectively replacing the \r with \n on-the-fly in the tokenizer (but not in the code that does line counting). This is safe because an empty line is just ignored.

This change had a beneficial side effect of simplifying code, reducing states etc.

@mdmueller ?

@mdmueller
Copy link
Contributor

Looks good to me! 👍

@taldcroft taldcroft merged commit 66156a2 into astropy:master Oct 3, 2016
@taldcroft taldcroft deleted the ascii-windows branch October 3, 2016 00:03
eteq pushed a commit that referenced this pull request Dec 21, 2016
Fix a bug with empty value at end of tab-delimited table on windows
eteq pushed a commit that referenced this pull request Dec 21, 2016
Fix a bug with empty value at end of tab-delimited table on windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants