Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Error on LC_TIME return none (Windows) #3

Closed
M0NsTeRRR opened this issue Sep 29, 2018 · 1 comment
Closed

Error on LC_TIME return none (Windows) #3

M0NsTeRRR opened this issue Sep 29, 2018 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@M0NsTeRRR
Copy link
Member

M0NsTeRRR commented Sep 29, 2018

INFO:bot:Log command! ('Action', 'Command used', 'Name', '!ping')
Ignoring exception in command ping:
Traceback (most recent call last):
  File "C:\Users\maste\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 61, in wrapped
    ret = await coro(*args, **kwargs)
  File "D:\Documents\Travail\Informatique\Github\Discord-BOT-AdminAFK\functions\decorators.py", line 51, in wrapper
    return await func(self, ctx, *args, **kwargs)
  File "D:\Documents\Travail\Informatique\Github\Discord-BOT-AdminAFK\functions\decorators.py", line 63, in wrap
    return await func(self, ctx, *args, **kwargs)
  File "D:\Documents\Travail\Informatique\Github\Discord-BOT-AdminAFK\extensions\admin.py", line 218, in ping
    "Name", "!ping")
  File "D:\Documents\Travail\Informatique\Github\Discord-BOT-AdminAFK\bot.py", line 21, in log
    now = format_datetime(datetime.now())
  File "C:\Users\maste\AppData\Local\Programs\Python\Python36-32\lib\site-packages\babel\dates.py", line 732, in format_datetime
    return get_datetime_format(format, locale=locale) \
  File "C:\Users\maste\AppData\Local\Programs\Python\Python36-32\lib\site-packages\babel\dates.py", line 392, in get_datetime_format
    patterns = Locale.parse(locale).datetime_formats
AttributeError: 'NoneType' object has no attribute 'datetime_formats'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\maste\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\bot.py", line 896, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\maste\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 533, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\maste\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 70, in wrapped
    raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'datetime_formats'
@egguy
Copy link
Contributor

egguy commented Oct 10, 2018

Hi,

As a workaround, you can set the environment variable to the desired locale before running the script, ex:

set LC_TIME=en_US
python main.py

@egguy egguy added the bug Something isn't working label Oct 10, 2018
@egguy egguy self-assigned this Oct 10, 2018
@M0NsTeRRR M0NsTeRRR pinned this issue Oct 5, 2019
@egguy egguy mentioned this issue Oct 19, 2019
@M0NsTeRRR M0NsTeRRR unpinned this issue Oct 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants