python-3.x - python3 bot的问题:ValueError:int()的无效文字,基数为10:''
问题描述
运行 python3 机器人时,我收到以下错误:
ValueError: int() 以 10 为底的无效文字:''
一直在查看 main.py 以尝试查看问题出在哪里,但没有运气。我承认我缺乏经验,只是想学习一些新东西,任何帮助将不胜感激。
以下是错误:
wirng@localhost:~/bot# python3 main.py
Traceback (most recent call last):
File "main.py", line 1133, in <module>
client = BotClient(max_messages=10)
File "main.py", line 274, in __init__
self.config = Config()
File "main.py", line 133, in __init__
self.patreon_server = int(config.get('DEFAULT', 'patreon_server'))
ValueError: invalid literal for int() with base 10: ''
我不确定错误来自哪里,但我认为它来自这部分代码:
self.patreon = config.get('DEFAULT', 'patreon_enabled') == 'yes'
self.patreon_server = int(config.get('DEFAULT', 'patreon_server'))
if self.patreon:
logger.info('Patreon is enabled. Will look for servers {}'.format(self.patreon_server))
解决方案
推荐阅读
- java - 在 Maven 项目中找不到 ImmutableMap
- c# - 我不知道如何写检查 - 如果元素在网站上
- cypress - 如何在另一个 spec.js 中重用代码?
- html - 需要单个 HTML 结构作为桌面和移动设备的附加屏幕截图,而无需复制元素。flexbox可以吗?
- google-cloud-platform - 尝试在 Google Cloud Platform 实例上运行 VMWare Workstation?
- python - 限制非守护程序池 Python 中的核心数
- ios - Swift 5 和 iOS 13 UISearchController 错误的呈现和关闭行为
- php - PHP以漂亮的格式打印xml文件
- node.js - 在使用 Visual Studio 代码时,我可以在 nodejs 调试中跳过节点内部模块吗?
- laravel - 从源“xyz.com”访问“abc.com”处的 XMLHttpRequest 已被 CORS 策略禁止“访问控制允许来源”