File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
scrapy/core/downloader/handlers Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 4
4
import logging
5
5
from io import BytesIO
6
6
from time import time
7
+ import warnings
7
8
from six .moves .urllib .parse import urldefrag
8
9
9
10
from zope .interface import implementer
18
19
from scrapy .http import Headers
19
20
from scrapy .responsetypes import responsetypes
20
21
from scrapy .core .downloader .webclient import _parse
21
- from scrapy .core .downloader .tls import openssl_methods , METHOD_TLS
22
+ from scrapy .core .downloader .tls import openssl_methods
22
23
from scrapy .utils .misc import load_object
23
24
from scrapy .utils .python import to_bytes , to_unicode
24
25
from scrapy import twisted_version
@@ -39,9 +40,12 @@ def __init__(self, settings):
39
40
try :
40
41
self ._contextFactory = self ._contextFactoryClass (method = self ._sslMethod )
41
42
except TypeError :
42
- # use defaults
43
+ # use context factory defaults
43
44
self ._contextFactory = self ._contextFactoryClass ()
44
-
45
+ warnings .warn ("""
46
+ You are using a context factory class that does not accept the `method` argument
47
+ (type OpenSSL.SSL method, e.g. OpenSSL.SSL.SSLv23_METHOD).
48
+ Please upgrade your context factory class to handle or ignore it.""" )
45
49
self ._default_maxsize = settings .getint ('DOWNLOAD_MAXSIZE' )
46
50
self ._default_warnsize = settings .getint ('DOWNLOAD_WARNSIZE' )
47
51
self ._disconnect_timeout = 1
You can’t perform that action at this time.
0 commit comments