twitter: Fix buggy handling of config_file in Python 3.
This fixes the most broken part of
MODIFY
zulip/integrations/twitter/twitter-bot
zulip/integrations/twitter/twitter-bot
@@ -35,9 +35,9 @@ CONFIGFILE = os.path.expanduser("~/.zulip_twitterrc")
def write_config(config, since_id, user):
# type: (ConfigParser, int, int) -> None
- config.set('twitter', 'since_id', since_id)
- config.set('twitter', 'user_id', user)
- with open(CONFIGFILE, 'wb') as configfile:
+ config.set('twitter', 'since_id', str(since_id))
+ config.set('twitter', 'user_id', str(user))
+ with open(CONFIGFILE, 'w') as configfile:
config.write(configfile)
parser = zulip.add_default_arguments(argparse.ArgumentParser(r"""

MODIFY
zulip/integrations/twitter/twitter-search-bot
zulip/integrations/twitter/twitter-search-bot
@@ -37,8 +37,8 @@ def write_config(config, since_id):
# type: (ConfigParser, int) -> None
if 'search' not in config.sections():
config.add_section('search')
- config.set('search', 'since_id', since_id)
- with open(CONFIGFILE, 'wb') as configfile:
+ config.set('search', 'since_id', str(since_id))
+ with open(CONFIGFILE, 'w') as configfile:
config.write(configfile)
parser = zulip.add_default_arguments(argparse.ArgumentParser(r"""

twitter: Fix buggy handling of config_file in Python 3.

This fixes the most broken part of #88.