Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecation Warning in an example from README.rst #229

Closed
leovp opened this issue Feb 9, 2017 · 1 comment
Closed

Deprecation Warning in an example from README.rst #229

leovp opened this issue Feb 9, 2017 · 1 comment

Comments

@leovp
Copy link

leovp commented Feb 9, 2017

Steps to reproduce:

  1. Create a new virtualenv (to avoid conflicts and what not);
  2. Install the latest grab from pypi;
  3. Create main.py and copy-paste a "Grab::Spider Example" from README.rst;
  4. Run the script.

Result:

DEBUG:grab.spider.base:Using memory backend for task queue
DEBUG:grab.network:[01] GET https://www.google.com/search?q=python
DEBUG:grab.network:[02] GET https://www.google.com/search?q=ruby
/home/leovp/.pyenv/versions/habratest-3.5.2/lib/python3.5/site-packages/grab/deprecated.py:250: GrabDeprecationWarning: The Grab.response attribute is deprecated. Use Grab.doc instead.
warn('The Grab.response attribute is deprecated. '
DEBUG:grab.network:[03] GET https://www.google.com/search?q=perl
python: https://www.python.org/
ruby: https://ru.wikipedia.org/wiki/Ruby
DEBUG:grab.stat:RPS: 2.68 []
perl: https://ru.wikipedia.org/wiki/Perl
DEBUG:grab.stat:RPS: 0.00 []
DEBUG:grab.spider.parser_pipeline:Started shutdown of parser process: Thread-1
DEBUG:grab.spider.parser_pipeline:Finished joining parser process: Thread-1
DEBUG:grab.spider.base:Main process [pid=17426]: work done

The issue here is that Grab::Spider Example doesn't access grab.response attribute directly, so the warning is not justified in that case.

@lorien lorien closed this as completed in d650e64 Feb 11, 2017
@lorien
Copy link
Owner

lorien commented Feb 12, 2017

I've fixed in master branch. Will release on pypi in 1-2 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants