invalid literal for float(): 和 OverflowError: cannot convert float infinity to integer 问题

CRITICAL:报错信息为:Traceback (most recent call last):
 File "/opt/HDS_volume_expand.py", line 220, in vv_expand_check
   vv_size = type_conversion((vv_show_read_1[0]) * 1024)
 File "/opt/HDS_volume_expand.py", line 16, in type_conversion
   num = math.ceil(float(str))
ValueError: invalid literal for float(): 4.4634.4634.4634.4634.4634.4634.4634.4634.4634.4634.4634.*

CRITICAL:报错信息为:Traceback (most recent call last):
 File "/opt/HDS_volume_expand.py", line 291, in 
   vv_expand_check()
 File "/opt/HDS_volume_expand.py", line 229, in vv_expand_check
   if int(vv_size) >= type_conversion(prd_volume_expand):
OverflowError: cannot convert float infinity to integer
 

错误的原因来自于type_conversion((vv_show_read_1[0]) * 1024)  (vv_show_read_1[0])是一个字符串,本意是先进行类型转换,再进行*1024的计算,但因为括号忘记删除的原因,导致了字符串和数字相乘,产生了这2个错误, 前者是vv_show_read_1[0]转换后是一个小数,后者vv_show_read_1[0]转换后是这个整数。 这2个问题都可以归咎到inf错误。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值