scrapy-plugins / scrapy-zyte-smartproxy

Zyte Smart Proxy Manager (formerly Crawlera) middleware for Scrapy
BSD 3-Clause "New" or "Revised" License
356 stars 88 forks source link

Fix encoding of reported X-Crawlera-Error in stats #33

Closed redapple closed 7 years ago

redapple commented 7 years ago

In Python 3, X-Crawlera-Errors appear in the stats represented as a bytes string, e.g: "crawlera/response/error/b'somethingbad'": 1

This patch converts the header value to unicode when incrementing the stats counter.

codecov-io commented 7 years ago

Current coverage is 93.75% (diff: 100%)

Merging #33 into master will increase coverage by 1.56%

@@             master        #33   diff @@
==========================================
  Files             2          2          
  Lines           128        128          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits            118        120     +2   
+ Misses           10          8     -2   
  Partials          0          0          

Powered by Codecov. Last update d3b5175...5850bf3

eLRuLL commented 7 years ago

wow, and the coverage looks great too! 👍