diff --git a/puppet/zulip/files/postgresql/process_fts_updates b/puppet/zulip/files/postgresql/process_fts_updates index a23286874d..8ddd81da3d 100755 --- a/puppet/zulip/files/postgresql/process_fts_updates +++ b/puppet/zulip/files/postgresql/process_fts_updates @@ -25,7 +25,7 @@ import psycopg2.extensions import select import time import logging -import six.moves.configparser +import configparser import sys import os @@ -80,7 +80,7 @@ except ImportError as e: # # However, we still also check the `USING_PGROONGA` variable, since # that's all we have in development. -config_file = six.moves.configparser.RawConfigParser() +config_file = configparser.RawConfigParser() config_file.read("/etc/zulip/zulip.conf") if config_file.has_option('machine', 'pgroonga'): USING_PGROONGA = True diff --git a/scripts/lib/email-mirror-postfix b/scripts/lib/email-mirror-postfix index 9ae24b0ade..7b0dbe7735 100755 --- a/scripts/lib/email-mirror-postfix +++ b/scripts/lib/email-mirror-postfix @@ -50,7 +50,7 @@ import json from six.moves.urllib.parse import urljoin, urlencode from six.moves.urllib.request import Request, urlopen from six.moves.urllib.error import HTTPError -from six.moves.configparser import RawConfigParser +from configparser import RawConfigParser from six import text_type diff --git a/scripts/upgrade-zulip-from-git b/scripts/upgrade-zulip-from-git index 6081d472f4..0b6258419f 100755 --- a/scripts/upgrade-zulip-from-git +++ b/scripts/upgrade-zulip-from-git @@ -1,6 +1,6 @@ #!/usr/bin/env python3 import os -from six.moves import configparser +import configparser import sys import subprocess import logging diff --git a/scripts/zulip-puppet-apply b/scripts/zulip-puppet-apply index e0bd77accf..ed0433ea92 100755 --- a/scripts/zulip-puppet-apply +++ b/scripts/zulip-puppet-apply @@ -3,7 +3,7 @@ import os import sys import subprocess -import six.moves.configparser as configparser +import configparser import re force = False diff --git a/tools/check-issue-labels b/tools/check-issue-labels index 488135d933..08ecc411dd 100755 --- a/tools/check-issue-labels +++ b/tools/check-issue-labels @@ -6,7 +6,7 @@ import argparse import sys import os -from six.moves.configparser import ConfigParser +import ConfigParser from typing import Any, Dict, MutableMapping, Optional, Text # Scans zulip repositary for issues that don't have any `area` labels. diff --git a/zerver/lib/bot_lib.py b/zerver/lib/bot_lib.py index 5ebf52d537..438cb0ff85 100644 --- a/zerver/lib/bot_lib.py +++ b/zerver/lib/bot_lib.py @@ -12,7 +12,7 @@ from zerver.lib.bot_storage import get_bot_state, set_bot_state, \ is_key_in_bot_state, get_bot_state_size, remove_bot_state from zerver.lib.integrations import EMBEDDED_BOTS -from six.moves import configparser +import configparser if False: from mypy_extensions import NoReturn diff --git a/zilencer/management/commands/sync_api_key.py b/zilencer/management/commands/sync_api_key.py index 2a2d31293a..f8b71e38f4 100644 --- a/zilencer/management/commands/sync_api_key.py +++ b/zilencer/management/commands/sync_api_key.py @@ -3,7 +3,7 @@ from typing import Any from django.core.management.base import BaseCommand from zerver.models import get_realm, get_user, UserProfile import os -from six.moves.configparser import ConfigParser +from configparser import ConfigParser class Command(BaseCommand): help = """Sync your API key from ~/.zuliprc into your development instance""" @@ -15,12 +15,7 @@ class Command(BaseCommand): raise RuntimeError("No ~/.zuliprc found") config = ConfigParser() with open(config_file, 'r') as f: - # Apparently, six.moves.configparser.ConfigParser is not - # consistent between Python 2 and 3! - if hasattr(config, 'read_file'): - config.read_file(f, config_file) - else: - config.readfp(f, config_file) + config.read_file(f, config_file) api_key = config.get("api", "key") email = config.get("api", "email") diff --git a/zproject/settings.py b/zproject/settings.py index 11ab7b886d..63b651dcdf 100644 --- a/zproject/settings.py +++ b/zproject/settings.py @@ -15,7 +15,7 @@ import os import platform import time import sys -import six.moves.configparser +import configparser from zerver.lib.db import TimeTrackingConnection import zerver.lib.logging_util @@ -26,14 +26,14 @@ import zerver.lib.logging_util DEPLOY_ROOT = os.path.join(os.path.realpath(os.path.dirname(__file__)), '..') -config_file = six.moves.configparser.RawConfigParser() +config_file = configparser.RawConfigParser() config_file.read("/etc/zulip/zulip.conf") # Whether this instance of Zulip is running in a production environment. PRODUCTION = config_file.has_option('machine', 'deploy_type') DEVELOPMENT = not PRODUCTION -secrets_file = six.moves.configparser.RawConfigParser() +secrets_file = configparser.RawConfigParser() if PRODUCTION: secrets_file.read("/etc/zulip/zulip-secrets.conf") else: @@ -586,7 +586,7 @@ try: # For get_updates hostname sharding. domain = config_file.get('django', 'cookie_domain') CSRF_COOKIE_DOMAIN = '.' + domain -except six.moves.configparser.Error: +except configparser.Error: # Failing here is OK pass