-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix an issue that caused the astropy table reader on Windows to behave differently to other platforms #2519
Conversation
…e differently to other platforms and read binary files as tables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May give it a try with encoding
only set in the first pass.
That seems to resolve the test failures; wondering if there still might be text formats that we are not testing here? |
# files, which is an issue since it will start recognizing e.g. PNGs as | ||
# valid tables. | ||
encoding = 'utf-8' | ||
|
||
from astropy.table import Table | ||
|
||
# In Python 3, as of Astropy 0.4, if the format is not specified, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's been closed as of 2019 I think, but having to try ASCII first now certainly holds again ;-)
Finally got the dev jobs through, so this seems to work at least for all tests. >>> with make_file(data, '.png') as fname:
... for df in data_factory:
... print(df.label, df.priority, df.identifier(fname))
...
FITS file 100 False
HDF5 file 100 False
Numpy save file 100 False
ASCII Table 1 False
FITS table 1 False
VO table 1 False
AASTeX Table 0 False
Auto 0 True
CDS Catalog 0 False
Catalog (astropy.table parser) 0 False
DAOphot Catalog 0 False
Excel 0 False
IPAC Catalog 0 False
Image 0 True
LaTeX Table 0 False
Pandas Table 0 False
SExtractor Catalog 0 False
CASA PPV Cube -1000 False My interpretation of that is even if Pandas or LaTeX identified as |
CI is green, let's merge! |
Yes, I guess if issues with other text formats should pop up, we can always fix them later. |
On Windows, the default encoding/locale seems to be
cp1252
which will read random binary files without complaining, which is not ideal for automatic format recognition.cc @dhomeier