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

Check for errors on /verify #26

Open
lgg opened this issue Jan 10, 2018 · 2 comments
Open

Check for errors on /verify #26

lgg opened this issue Jan 10, 2018 · 2 comments

Comments

@lgg
Copy link
Contributor

lgg commented Jan 10, 2018

in telegram message history:

image

while in logs:

2018-01-10 04:11:59,686 - TwitterForwarderBot - DEBUG - No new updates found.
2018-01-10 04:12:02,492 - TwitterForwarderBot - DEBUG - Getting updates: [434142446]
None
None
2018-01-10 04:12:03,170 - telegram.ext.dispatcher - ERROR - An uncaught error was raised while processing the update
Traceback (most recent call last):
  File "/home/webadmin/www/console/telegram/chat-crypto/telegram-twitter-forwarder-bot/venv/lib/python3.5/site-packages/telegram/ext/dispatcher.py", line 203, in process_update
    handler.handle_update(update, self)
  File "/home/webadmin/www/console/telegram/chat-crypto/telegram-twitter-forwarder-bot/venv/lib/python3.5/site-packages/telegram/ext/commandhandler.py", line 86, in handle_update
    return self.callback(dispatcher.bot, update, **optional_args)
  File "/home/webadmin/www/console/telegram/chat-crypto/telegram-twitter-forwarder-bot/util.py", line 14, in wrapper
    return f(bot, update, *args, **kwargs)
  File "/home/webadmin/www/console/telegram/chat-crypto/telegram-twitter-forwarder-bot/commands.py", line 268, in cmd_verify
    cmd_set_timezone(bot, update, [tz_name])
  File "/home/webadmin/www/console/telegram/chat-crypto/telegram-twitter-forwarder-bot/util.py", line 14, in wrapper
    return f(bot, update, *args, **kwargs)
  File "/home/webadmin/www/console/telegram/chat-crypto/telegram-twitter-forwarder-bot/commands.py", line 298, in cmd_set_timezone
    tz = timezone(tz_name)
  File "/home/webadmin/www/console/telegram/chat-crypto/telegram-twitter-forwarder-bot/venv/lib/python3.5/site-packages/pytz/__init__.py", line 173, in timezone
    if zone.upper() == 'UTC':
AttributeError: 'NoneType' object has no attribute 'upper'
2018-01-10 04:12:12,503 - TwitterForwarderBot - DEBUG - No new updates found.

@lgg
Copy link
Contributor Author

lgg commented Jan 10, 2018

To avoid this error you need to change default timezone in Twitter settings, otherwise Twitter API won't return time_zone parameter when

tz_name = settings.get("time_zone", {}).get("tzinfo_name")

Settings list before changing default timezone:
image

Settings list after changing default timezone:
image


I think we need to add this to Readme or check in code for 'time_zone' parameter existence

@franciscod
Copy link
Owner

I've updated pytz alongside other dependencies. Maybe this is fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants