8

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

4
  • 1
    bugs.python.org/issue25155 Commented Jul 10, 2016 at 22:33
  • maybe this: kaggle.com/c/helping-santas-helpers/forums/t/11425/… Commented Jul 10, 2016 at 22:35
  • 1
    Does the error message include a stack trace? If so, that's important information, and you should post that too. If it doesn't have a stack trace, that's also important information, and you should say so explicitly. Also, can you post an MCVE that triggers the error when you run it? We can't usually debug code we can't see. Commented Jul 10, 2016 at 22:37
  • As a note, this error message wasn't including a stack trace in my case and may not have been for the asker either, which makes triage a bit more difficult. Commented Jan 15, 2019 at 13:57

4 Answers 4

11

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.

Sign up to request clarification or add additional context in comments.

2 Comments

I just encountered this exact same issue on WSL! This is the first hit on Google, thank you so much.
Just encountered in WSL2. :)
3

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

Comments

1

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

Comments

0

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

I got the error when doing sudo apt update.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.