Skip to content

Commit d42a98d

Browse files
committed
Use newer w3lib.url.safe_url_string() and re-enable HTTP request tests
1 parent 10d03ee commit d42a98d

File tree

3 files changed

+228
-65
lines changed

3 files changed

+228
-65
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Twisted>=10.0.0
22
lxml
33
pyOpenSSL
44
cssselect>=0.9
5-
w3lib>=1.13.0
5+
w3lib>=1.14.1
66
queuelib
77
six>=1.5.2
88
PyDispatcher>=2.0.5

scrapy/http/request/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from w3lib.url import safe_url_string
99

1010
from scrapy.http.headers import Headers
11-
from scrapy.utils.python import to_native_str, to_bytes
11+
from scrapy.utils.python import to_bytes
1212
from scrapy.utils.trackref import object_ref
1313
from scrapy.utils.url import escape_ajax
1414
from scrapy.http.common import obsolete_setter
@@ -50,8 +50,8 @@ def _set_url(http://github.com/self,%20url):
5050
if not isinstance(url, six.string_types):
5151
raise TypeError('Request url must be str or unicode, got %s:' % type(url).__name__)
5252

53-
url = to_native_str(url, self.encoding)
54-
self._url = escape_ajax(safe_url_string(url))
53+
s = safe_url_string(url, self.encoding)
54+
self._url = escape_ajax(s)
5555

5656
if ':' not in self._url:
5757
raise ValueError('Missing scheme in request url: %s' % self._url)

0 commit comments

Comments
 (0)