You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mscvrt not found when calling fits.open() on Python 3.5 on Win10 #4342
When using fits.open(...) on Python 3.5 / Windows 10, I got error message:
C:\Python35\lib\site-packages\astropy\io\fits\util.py:577: UserWarning: Could not find appropriate MS Visual C Runtime library or library is corrupt/misconfigured; cannot determine whether your file object was opened in append mode. Please consider using a file object opened in write mode instead.
'Could not find appropriate MS Visual C Runtime '
Indeed, it is the same issue (that is, the use of ctypes.util.find_msvcrt). In the case of astropy.io.fits it isn't really a serious issue, but good to know about so thanks for pointing it out.
So is this something that can be fixed in astropy, or does it require a more up-to-date pyreadline? (That is, should we close this and/or add it to the "known issues" list?)
@eteq This has nothing to do with pyreadline--it's just that the same bug is there. This is something that needs, presumably, to be fixed in Astropy (really it's an upstream issue in Python that needs to be worked around).
Also, it occurs to me that this warning is coming up in contexts where it's really pretty irrelevant. It is only relevant when opening the file with mode='append', and passing in an open file handle. The code here is trying to determine that the raw file handle was opened in append mode (or at least write, in which case we can emulate append). In the case of just passing in a filename we don't care, and the user shouldn't be bothered with this. But changing this will require yet another bit of refactoring of the _File class.
@MSeifert04 pointed out that #4792 fixes this (suggested by the 3.5 tests now passing), so I'll close this.
It's possible there's some additional problems that the #4792 fix uncovered that create this - it's not completely clear to me if the test suite actually covers this. But I think so? If not, this can be re-oepend.
Activity
embray commentedon Nov 24, 2015
Indeed, it is the same issue (that is, the use of
ctypes.util.find_msvcrt). In the case ofastropy.io.fitsit isn't really a serious issue, but good to know about so thanks for pointing it out.eteq commentedon Dec 2, 2015
So is this something that can be fixed in astropy, or does it require a more up-to-date pyreadline? (That is, should we close this and/or add it to the "known issues" list?)
embray commentedon Dec 2, 2015
@eteq This has nothing to do with pyreadline--it's just that the same bug is there. This is something that needs, presumably, to be fixed in Astropy (really it's an upstream issue in Python that needs to be worked around).
embray commentedon Dec 21, 2015
Also, it occurs to me that this warning is coming up in contexts where it's really pretty irrelevant. It is only relevant when opening the file with
mode='append', and passing in an open file handle. The code here is trying to determine that the raw file handle was opened in append mode (or at least write, in which case we can emulate append). In the case of just passing in a filename we don't care, and the user shouldn't be bothered with this. But changing this will require yet another bit of refactoring of the_Fileclass.astrofrog commentedon Jan 8, 2016
anntzer commentedon Apr 12, 2016
You may want to check https://bugs.python.org/issue26727 and the linked issue.
eteq commentedon Apr 19, 2016
@MSeifert04 pointed out that #4792 fixes this (suggested by the 3.5 tests now passing), so I'll close this.
It's possible there's some additional problems that the #4792 fix uncovered that create this - it's not completely clear to me if the test suite actually covers this. But I think so? If not, this can be re-oepend.