Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

报错Caught Exception: invalid literal for int() with base 10: '' #170

Open
pipidaxian opened this issue May 16, 2022 · 14 comments
Open

报错Caught Exception: invalid literal for int() with base 10: '' #170

pipidaxian opened this issue May 16, 2022 · 14 comments

Comments

@pipidaxian
Copy link

麻烦帮看看这是什么原因,在仅ipv6的Debian11机器上的,改了resolv.conf,所以可以访问ipv4了,但是报错:

Connecting...
Authentication successful. Access granted.

You are connecting via: IPv4

Caught Exception: invalid literal for int() with base 10: ''
^CTraceback (most recent call last):
File "/root/client-linux.py", line 308, in
CPU = get_cpu()
File "/root/client-linux.py", line 81, in get_cpu
t = delta_time()
File "/root/client-linux.py", line 73, in delta_time
x = get_time()
File "/root/client-linux.py", line 69, in get_time
time_list[i] = int(time_list[i])
ValueError: invalid literal for int() with base 10: ''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/root/client-linux.py", line 359, in
time.sleep(3)
KeyboardInterrupt

@pipidaxian
Copy link
Author

哦对,只有这个客户端报错了,其他客户端是好的,所以应该不是服务端的问题

@cppla
Copy link
Owner

cppla commented May 23, 2022

python3 --version

@pipidaxian
Copy link
Author

pipidaxian commented May 30, 2022

python3 --version

3.9.2版本

@cppla
Copy link
Owner

cppla commented May 30, 2022

你机器有多个python环境导致的吧,python 3.9.2 测试无法复现。 @pipidaxian

@pipidaxian
Copy link
Author

你机器有多个python环境导致的吧,python 3.9.2 测试无法复现。 @pipidaxian

预装的debian 11自带的吧,刚开的机,还啥也没装,我看了下,好像/use/bin里既有Python 3,也有Python 3.9,是不是问题在这

@cppla
Copy link
Owner

cppla commented Jun 8, 2022

不太清楚,我测试环境是debian11,python 3.9.2 无法复现。 可以看下出现问题的python具体版本,我好修复。

@pipidaxian
Copy link
Author

pipidaxian commented Jun 19, 2022

不太清楚,我测试环境是debian11,python 3.9.2 无法复现。 可以看下出现问题的python具体版本,我好修复。

要怎么看?我这个是一台LXC小鸡,我感觉是不是跟开出来这个VPS的主服务器有关,我现在换成了ubuntu 22.04系统,结果还是一样报错

@cppla
Copy link
Owner

cppla commented Jun 20, 2022

cat /proc/stat 贴一下

@pipidaxian
Copy link
Author

89EC2ED2-E699-4606-A88F-B4BE8886D57A
44B1DC6C-90F8-4AAB-897B-5C80877D30DC

@cppla
Copy link
Owner

cppla commented Jun 20, 2022

截图不全,应该是你这个文件出现了浮点数,不太确定为什么出现,试试这个文件是否报错。@pipidaxian

wget --no-check-certificate -qO client-linux.py 3.0.3.0/cache/77605047768192515.py

@pipidaxian
Copy link
Author

pipidaxian commented Jun 20, 2022

截图不全,应该是你这个文件出现了浮点数,不太确定为什么出现,试试这个文件是否报错。@pipidaxian

wget --no-check-certificate -qO client-linux.py 3.0.3.0/cache/77605047768192515.py

我编辑这个文件指向我的服务端并运行python3后,仍然报错:

Connecting...
Authentication successful. Access granted.

You are connecting via: IPv4

Caught Exception: could not convert string to float: ''
^CTraceback (most recent call last):
 File "/root/client-linux.py", line 374, in <module>
  CPU = get_cpu()
  File "/root/client-linux.py", line 80, in get_cpu
    t = delta_time()
  File "/root/client-linux.py", line 72, in delta_time
    x = get_time()
  File "/root/client-linux.py", line 68, in get_time
    time_list[i] = int(float(time_list[i]))
ValueError: could not convert string to float: ''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/client-linux.py", line 427, in <module>
    time.sleep(3)
KeyboardInterrupt

有个细节,我的client-linux.py用nano打开编辑,发现中文都是乱码,不能正常显示,是不是跟这个有关系?但我试过删除文件中的中文,也不行。

@cppla
Copy link
Owner

cppla commented Jul 16, 2022

不太清楚,暂时就在你的小鸡上出现了此问题。 todo

@andrewcapture
Copy link

我也出现了今天。只有一个客户端,python 3.10.9

@wxf26054
Copy link

Connecting...
Caught Exception: argument should be integer or bytes-like object, not 'str'

python3.9.13版本

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants