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

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

Open
FabioNevesRezende opened this issue Apr 18, 2019 · 2 comments
Open

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

FabioNevesRezende opened this issue Apr 18, 2019 · 2 comments

Comments

@FabioNevesRezende
Copy link

I've just followed the step to install and setup using docker, when I run docker-compose up it fails with:

bot_1 | Traceback (most recent call last):
bot_1 | File "run.py", line 3, in
bot_1 | from src.bot import Bot
bot_1 | File "/code/src/bot.py", line 6, in
bot_1 | from src.handler import *
bot_1 | File "/code/src/handler/init.py", line 1, in
bot_1 | from .command_handler import CommandHandler
bot_1 | File "/code/src/handler/command_handler.py", line 7, in
bot_1 | from .commands import commands
bot_1 | File "/code/src/handler/commands/init.py", line 5, in
bot_1 | from src.handler.commands.moderate import Moderate
bot_1 | File "/code/src/handler/commands/moderate.py", line 5, in
bot_1 | class Moderate(Base):
bot_1 | File "/code/src/handler/commands/moderate.py", line 7, in Moderate
bot_1 | gods = config.getlist('bot', 'god_mode', type=int)
bot_1 | File "/code/src/config.py", line 18, in getlist
bot_1 | return list(map(lambda o: type(o), config.get(section, option).split(',')))
bot_1 | File "/code/src/config.py", line 18, in
bot_1 | return list(map(lambda o: type(o), config.get(section, option).split(',')))
bot_1 | ValueError: invalid literal for int() with base 10: ''
imaginaryfriend_bot_1 exited with code 1

@mikekytyzov
Copy link

mikekytyzov commented Jul 23, 2019

i tried to run from docker but it doesnt work

i give to you my solution with the same problem

add key to config
[bot]
god_mode=some_integer

and the second - i am not python programmer but i just replace a get_list from config.py

def getlist(self, section, option, type=str):
    def handler(o):
      return type(o)
    el_list = config.get(section, option).split(',')
    mapped = map(handler, el_list)
    return list(mapped)

and it works

@matheusbach
Copy link

works for me

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

3 participants