From 9c18c0b4ed7f37accdd1e57e98082ed5cce8383a Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 22 Aug 2017 17:19:57 -0700 Subject: [PATCH] twitter: Fix buggy handling of config_file in Python 3. This fixes the most broken part of #88. --- zulip/integrations/twitter/twitter-bot | 6 +++--- zulip/integrations/twitter/twitter-search-bot | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/zulip/integrations/twitter/twitter-bot b/zulip/integrations/twitter/twitter-bot index 9b29a5c..7d0cf36 100755 --- a/zulip/integrations/twitter/twitter-bot +++ b/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""" diff --git a/zulip/integrations/twitter/twitter-search-bot b/zulip/integrations/twitter/twitter-search-bot index 1ecc4df..793943e 100755 --- a/zulip/integrations/twitter/twitter-search-bot +++ b/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"""