Skip to content

Fix problem reading AASTex table without trailing backslashes at end - #5427

Merged
taldcroft merged 1 commit into
astropy:masterfrom
taldcroft:ascii-aastex-ending
Dec 2, 2016
Merged

taldcroft merged 1 commit into
astropy:masterfrom
taldcroft:ascii-aastex-ending

Conversation

@taldcroft

@taldcroft taldcroft commented Oct 22, 2016 •

Copy link
Copy Markdown
Member

Closes #5236. (By superceding).

@taldcroft

Copy link
Copy Markdown
Member Author

cc: @hamogu

@hamogu hamogu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. (The inline comment I left is clearly irrelevant since exactly this is tested in the tests.)

Comment thread astropy/io/ascii/latex.py
"""Remove whitespace at the beginning or end of line. Also remove
\\ at end of line"""
line = line.split('%')[0]
line = RE_COMMENT.split(line)[0]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know enough about regexpes: What is the line has white space list so: `data1 & data2 \ %and now a comment``?

Comment thread astropy/io/ascii/latex.py
if line[-2:] == r'\\':
line = line.strip(r'\\')
if line.endswith(r'\\'):
line = line.rstrip(r'\\')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can remove the if line.endswith(r'\\'): if you use rstrip. If it doesn't ends with \\ it just does nothing.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MSeifert04 - yup, that's correct. But in the interest not clogging up CI even more I'm merging this as-is. After the 1.3 frenzy quiets we can do this clean up.

@taldcroft
taldcroft merged commit 4346abc into astropy:master Dec 2, 2016
@taldcroft
taldcroft deleted the ascii-aastex-ending branch December 2, 2016 11:16
taldcroft added a commit to taldcroft/astropy that referenced this pull request Dec 2, 2016
taldcroft added a commit that referenced this pull request Dec 3, 2016
Remove debugging "print" introduced in #5427
eteq pushed a commit that referenced this pull request Dec 13, 2016
Fix problem reading AASTex table without trailing backslashes at end
@eteq

eteq commented Dec 13, 2016

Copy link
Copy Markdown
Member

backported to v1.0.x in 1f7cb64

eteq pushed a commit that referenced this pull request Dec 18, 2016
Fix problem reading AASTex table without trailing backslashes at end
eteq pushed a commit that referenced this pull request Dec 21, 2016
Fix problem reading AASTex table without trailing backslashes at end
eteq pushed a commit that referenced this pull request Dec 21, 2016
Remove debugging "print" introduced in #5427
eteq pushed a commit that referenced this pull request Dec 21, 2016
Remove debugging "print" introduced in #5427
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.

4 participants