jamesturk/scrapelib

Recent changes break urlopen?

Closed this issue · 5 comments

Using HEAD on Python 2.7.5:

  File "utils.py", line 297, in lxmlize
    entry = scraper.urlopen(url)
  File "/Users/james/.virtualenvs/scrapers_ca_app/src/scrapelib/scrapelib/__init__.py", line 307, in urlopen
    resp = self.request(method, url, data=body, retry_on_404=retry_on_404, **kwargs)
  File "/Users/james/.virtualenvs/scrapers_ca_app/src/scrapelib/scrapelib/__init__.py", line 282, in request
    headers = requests.sessions.merge_setting(headers, self.headers)
AttributeError: 'module' object has no attribute 'merge_setting'

hm, thanks for the report.

what version of requests?

On Thu, Apr 24, 2014 at 11:44 AM, James McKinney
notifications@github.comwrote:

Using HEADhttps://github.com/sunlightlabs/scrapelib/commit/5268c8d865aa34cacdb5d41889dab28049ffd9db
:

File "utils.py", line 297, in lxmlize
entry = scraper.urlopen(url)
File "/Users/james/.virtualenvs/scrapers_ca_app/src/scrapelib/scrapelib/init.py", line 307, in urlopen
resp = self.request(method, url, data=body, retry_on_404=retry_on_404, **kwargs)
File "/Users/james/.virtualenvs/scrapers_ca_app/src/scrapelib/scrapelib/init.py", line 282, in request
headers = requests.sessions.merge_setting(headers, self.headers)
AttributeError: 'module' object has no attribute 'merge_setting'


Reply to this email directly or view it on GitHubhttps://github.com//issues/18
.

I forget which version I was running at the time - when I came across that error, I was probably still on requests 1.0.0. The only other version I used was 2.2.1.

Ah is it not happening w/ 2.2.1? I think that might have been something that required a newer version.

Yes, actually, I think I came across this when I was starting a Python 3 / Pupa HEAD branch of scrapers-ca. That branch doesn't have this error anymore since it's now on 2.2.1.

I see you changed the minimum requests version in scrapelib to 1.2.2, but you haven't tagged a release yet. That version bump may resolve this issue.

You can test on 1.2.2 to be sure, but I'm satisfied to close this issue.

thanks, added test for 1.2.2 in Travis