0

When running a python3 bot im getting the following error:

ValueError: invalid literal for int() with base 10: ''

Been looking through main.py to try and see where the problem is coming from with no luck. I'll admit i'm lacking experience and just trying to learn some new things, any help would be appreciated.

Below is the error:

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: ''

Im unsure where the error is coming from but i think its from this part of the code:

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))
wirng
  • 1
  • 2
  • The error tells you exactly what's wrong. You are passing an empty string into `int()` which you cant do. Meaning `config.get('DEFAULT', 'patreon_server')` is returning `''` – Loocid May 29 '19 at 03:09
  • Yeah, its official... i'm a moron lmao. Make a mistake on my config.ini file :/ – wirng May 29 '19 at 03:13
  • Possible duplicate of [ValueError: invalid literal for int () with base 10](https://stackoverflow.com/questions/13861594/valueerror-invalid-literal-for-int-with-base-10) – Tatranskymedved May 29 '19 at 05:59

0 Answers0