Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 223
williambraun Avatar asked Jul 10 '16 22:07

williambraun


3 Answers

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.

like image 103
bsplosion Avatar answered Sep 22 '22 00:09

bsplosion


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

like image 45
kraught Avatar answered Sep 24 '22 00:09

kraught


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

like image 28
Thiago Baldim Avatar answered Sep 21 '22 00:09

Thiago Baldim