deprecation warning about features='lxml' parser doesn't specify kwargs nor do docstrings

Bug #1780571 reported by Hobson Lane
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Beautiful Soup
Fix Released
Undecided
Unassigned

Bug Description

Second to last line of warning message could be more informative, since the docstring is not.

    ```
    >>> from bs4 import BeautifulSoup
    >>> soup = BeautifulSoup(markup=open('/Users/hobs/Dropbox/Docs/projects/deletefacebook/facebook-hobsonlane/html/contact_info.htm').read())

    /Users/hobsonlane/anaconda3/envs/nlpiaenv/lib/python3.6/site-packages/bs4/__init__.py:181:
    UserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("lxml"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.

    The code that caused this warning is on line 11 of the file /Users/hobsonlane/anaconda3/envs/nlpiaenv/bin/ipython. To get rid of this warning, change code that looks like this:

     BeautifulSoup(YOUR_MARKUP})

    to this:

     BeautifulSoup(YOUR_MARKUP, "lxml")

      markup_type=markup_type))
    ```

Revision history for this message
Leonard Richardson (leonardr) wrote :

In revision 451 I improved the warning message and added a docstring to the constructor.

Changed in beautifulsoup:
status: New → Fix Committed
Changed in beautifulsoup:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.