diff --git a/docs/news.rst b/docs/news.rst index a0f0c5697..d79844ed2 100644 --- a/docs/news.rst +++ b/docs/news.rst @@ -6,6 +6,12 @@ Release notes .. note:: Scrapy 1.x will be the last series supporting Python 2. Scrapy 2.0, planned for Q4 2019 or Q1 2020, will support **Python 3 only**. +Scrapy 1.7.2 (2019-07-23) +------------------------- + +Fix Python 2 support (:issue:`3889`, :issue:`3893`, :issue:`3896`). + + Scrapy 1.7.1 (2019-07-18) ------------------------- diff --git a/scrapy/utils/conf.py b/scrapy/utils/conf.py index 26d66eaf8..fb7ca3310 100644 --- a/scrapy/utils/conf.py +++ b/scrapy/utils/conf.py @@ -1,10 +1,13 @@ import os import sys import numbers -import configparser from operator import itemgetter import six +if six.PY2: + from ConfigParser import SafeConfigParser as ConfigParser +else: + from configparser import ConfigParser from scrapy.settings import BaseSettings from scrapy.utils.deprecate import update_classpath @@ -94,7 +97,7 @@ def init_env(project='default', set_syspath=True): def get_config(use_closest=True): """Get Scrapy config file as a ConfigParser""" sources = get_sources(use_closest) - cfg = configparser.ConfigParser() + cfg = ConfigParser() cfg.read(sources) return cfg