简体   繁体   English

python中的这个溢出错误是什么意思?

[英]What does this overflow error in python mean?

The full error is: OverflowError: timestamp too large to convert to C _PyTime_t完整的错误是: 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.我是 python 的新手,所以它可能是我遗漏的一些非常简单的东西。

The error is coming from this line of code within a function: time.sleep(t)错误来自函数中的这行代码: time.sleep(t)

t is a variable t是一个变量

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.我今天在 Ubuntu 的 Windows 子系统 Linux (WSL) 上运行 Python 3.7.2 时遇到了这个问题,所以蒂亚戈的答案并不普遍。 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 ).在做了一些研究之后,结果证明 WSL 不能在更长的时间内适当地处理正常运行时间(归功于“Petter S”找到了这个症状)。

Restarting Windows fixes the bad uptime and makes Python runnable again.重新启动 Windows 修复了糟糕的正常运行时间并使 Python 再次可运行。


Update 1: WSL 2 is officially announced with an expected release of June 2019 for Windows Insider builds.更新 1: WSL 2 正式宣布,预计将于 2019 年 6 月发布 Windows Insider 版本。 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.鉴于微软已经为 WSL 2 构建了一个新的 Linux 内核,我希望这个错误已经得到解决 - 如果有人在 WSL 2 上重现,请随时更新。


Update 2: WSL 2 is live and installable , possibly only for the Insider ring.更新 2: WSL 2 已上线且可安装,可能仅适用于 Insider 戒指。 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)https://github.com/microsoft/WSL/issues/3514按照说明重新启动 WSL 服务(所以我不需要重新启动)

All the broken tools, aws/python, ps, docker/tcp worked fine when I launched my Ubuntu WSL session again当我再次启动我的 Ubuntu WSL 会话时,所有损坏的工具,aws/python,ps,docker/tcp 都运行良好

In PowerShell (Admin)在 PowerShell 中(管理员)

PS C:\\WINDOWS\\system32> Get-Service LxssManager | 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看起来这个错误发生在 Python 3.5.0 中,就像这里的这个问题: https : //bugs.python.org/issue25155

Check your Python version.检查您的 Python 版本。 If its 3.5.0 change for the newest version 3.5.2如果它的 3.5.0 更改为最新版本 3.5.2

Closing the console in Windows and reopening it fixes the issue for me.在 Windows 中关闭控制台并重新打开它可以解决我的问题。

I got the error when doing sudo apt update .执行sudo apt update时出现错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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