williambraun
williambraun

Reputation: 93

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

Upvotes: 8

Views: 3561

Answers (4)

lcompare
lcompare

Reputation: 997

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

I got the error when doing sudo apt update.

Upvotes: 0

kraught
kraught

Reputation: 87

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

Upvotes: 3

bsplosion
bsplosion

Reputation: 2866

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.

Upvotes: 11

Thiago Baldim
Thiago Baldim

Reputation: 7732

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

Upvotes: 1

Related Questions