简体   繁体   中英

What does this overflow error in python mean?

The full error is: OverflowError: timestamp too large to convert to C _PyTime_t

I have no idea what this means, and have not been able to find it anywhere else online. I am new to python so it may be something really simple that I'm missing.

The error is coming from this line of code within a function: time.sleep(t)

t is a variable

I ran into this issue today while running Python 3.7.2 on Windows Subsystem for Linux (WSL) in Ubuntu, so Thiago's answer isn't universal. After doing some research, it turns out that WSL doesn't handle uptimes appropriately with longer periods of time ( credit to "Petter S" for finding this symptom ).

Restarting Windows fixes the bad uptime and makes Python runnable again.


Update 1: WSL 2 is officially announced with an expected release of June 2019 for Windows Insider builds. Given that Microsoft has built a new Linux kernel for WSL 2, I'd expect this bug to have been addressed - if anyone reproduces on WSL 2, please feel free to update.


Update 2: WSL 2 is live and installable , possibly only for the Insider ring. I haven't personally tested for this issue yet, but hopefully this issue is addressed as of this release.

From https://github.com/microsoft/WSL/issues/3514 followed instructions to restart WSL service (so I don't need to reboot)

All the broken tools, aws/python, ps, docker/tcp worked fine when I launched my Ubuntu WSL session again

In PowerShell (Admin)

PS C:\\WINDOWS\\system32> Get-Service LxssManager | Restart-Service

Looks like this error happens in Python 3.5.0 like this issue here: https://bugs.python.org/issue25155

Check your Python version. If its 3.5.0 change for the newest version 3.5.2

Closing the console in Windows and reopening it fixes the issue for me.

I got the error when doing sudo apt update .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM