Skip to content
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

boot_time() returns incorrect value on XP #1223

Closed
xiaolingbao opened this issue Feb 20, 2018 · 1 comment
Closed

boot_time() returns incorrect value on XP #1223

xiaolingbao opened this issue Feb 20, 2018 · 1 comment

Comments

@xiaolingbao
Copy link
Contributor

Build _pswindows.pyd with _WIN32_WINNT set to '0x501' and PSAPI_VERSION=1, and run:

c:\window> python -c "import psutil; print psutil.boot_time()"
4.74414813e+18

Cause:
uptime is defined as double with the above settings (

double uptime;
), Py_BuildValue() later on expects either ULONGLONG or LONGLONG. There is memory layout mismatch between the expected value format and the supplied.

This is a regression as the previous version uses double in both places.

@giampaolo
Copy link
Owner

Can you submit a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants