From fd24e22442d900170e7a5888b27698c9414b2983 Mon Sep 17 00:00:00 2001 From: Konstantin Lopuhin Date: Wed, 20 Jan 2016 23:30:58 +0300 Subject: [PATCH] use byte constants for prefix instead of encoding it --- scrapy/commands/fetch.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scrapy/commands/fetch.py b/scrapy/commands/fetch.py index 49fa18ab2..f09a873c1 100644 --- a/scrapy/commands/fetch.py +++ b/scrapy/commands/fetch.py @@ -29,16 +29,15 @@ class Command(ScrapyCommand): help="print response HTTP headers instead of body") def _print_headers(self, headers, prefix): - prefix = prefix.encode() for key, values in headers.items(): for value in values: self._print_bytes(prefix + b' ' + key + b': ' + value) def _print_response(self, response, opts): if opts.headers: - self._print_headers(response.request.headers, '>') + self._print_headers(response.request.headers, b'>') print('>') - self._print_headers(response.headers, '<') + self._print_headers(response.headers, b'<') else: self._print_bytes(response.body)