8000 BUG: detect buggy windows version and raise at import by mattip · Pull Request #17553 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: detect buggy windows version and raise at import #17553

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

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions numpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,26 @@ def _mac_os_check():
raise RuntimeError(msg)
del _mac_os_check

def _win_os_check():
"""
Quick Sanity check for Windows OS: look for fmod bug issue 16744.
"""
try:
a = arange(13 * 13, dtype= float64).reshape(13, 13)
a = a % 17 # calls fmod
linalg.eig(a)
except Exception:
msg = ("The current Numpy installation ({!r}) fails to "
"pass a sanity check due to a bug in the windows runtime. "
"See this issue for more information "
"https://developercommunity.visualstudio.com/content/problem/1208774/fpu-exception-in-fmod0-x-in-windows-10-version-200.html")
Copy link
Member

Choose a reason for hiding this comment

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

2004, not 200?

Copy link
Contributor

Choose a reason for hiding this comment

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

The URL is correct, despite missing the 4.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displaye 8000 d to describe this comment to others. Learn more.

NVM.

Copy link
Member

Choose a reason for hiding this comment

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

I used "https://tinyurl.com/y3dm3h86" instead.

raise RuntimeError(msg.format(__file__)) from None

if sys.platform == "win32" and sys.maxsize > 2**32:
_win_os_check()

del _win_os_check

Copy link
Member

Choose a reason for hiding this comment

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

I think there are some hard tabs in here.

# We usually use madvise hugepages support, but on some old kernels it
# is slow and thus better avoided.
# Specifically kernel version 4.6 had a bug fix which probably fixed this:
Expand Down
0