Skip to content

CI/TST: read_html test_banklist_url_positional_match failing with ResourceWarning on Travis #37766

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

Closed
jorisvandenbossche opened this issue Nov 11, 2020 · 3 comments
Labels
Duplicate Report Duplicate issue or pull request IO HTML read_html, to_html, Styler.apply, Styler.applymap Testing pandas testing functions or related to the test suite

Comments

@jorisvandenbossche
Copy link
Member

Travis builds are recently failing, eg https://travis-ci.org/github/pandas-dev/pandas/jobs/742927007

=================================== FAILURES ===================================

_____________ TestReadHtml.test_banklist_url_positional_match[bs4] _____________

[gw0] linux -- Python 3.7.8 /home/travis/miniconda3/envs/pandas-dev/bin/python

self = <pandas.tests.io.test_html.TestReadHtml object at 0x7f3091661050>

    @tm.network

    def test_banklist_url_positional_match(self):

        url = "http://www.fdic.gov/bank/individual/failed/banklist.html"

        # Passing match argument as positional should cause a FutureWarning.

        with tm.assert_produces_warning(FutureWarning):

            df1 = self.read_html(

>               url, "First Federal Bank of Florida", attrs={"id": "table"}

            )

pandas/tests/io/test_html.py:130: 

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <contextlib._GeneratorContextManager object at 0x7f309168d4d0>

type = None, value = None, traceback = None

    def __exit__(self, type, value, traceback):

        if type is None:

            try:

>               next(self.gen)

E               AssertionError: Caused unexpected warning(s): [('ResourceWarning', ResourceWarning("unclosed <ssl.SSLSocket fd=18, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('10.20.0.10', 43648), raddr=('172.217.212.95', 443)>"), '/home/travis/miniconda3/envs/pandas-dev/lib/python3.7/site-packages/html5lib/treebuilders/base.py', 38), ('ResourceWarning', ResourceWarning("unclosed <ssl.SSLSocket fd=16, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('10.20.0.10', 43650), raddr=('172.217.212.95', 443)>"), '/home/travis/miniconda3/envs/pandas-dev/lib/python3.7/site-packages/html5lib/treebuilders/base.py', 38), ('ResourceWarning', ResourceWarning("unclosed <ssl.SSLSocket fd=43, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('10.20.0.10', 43962), raddr=('172.217.214.95', 443)>"), '/home/travis/miniconda3/envs/pandas-dev/lib/python3.7/site-packages/bs4/builder/_html5lib.py', 335), ('ResourceWarning', ResourceWarning("unclosed <ssl.SSLSocket fd=42, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('10.20.0.10', 46504), raddr=('74.125.124.95', 443)>"), '/home/travis/miniconda3/envs/pandas-dev/lib/python3.7/site-packages/bs4/builder/_html5lib.py', 335), ('ResourceWarning', ResourceWarning("unclosed <ssl.SSLSocket fd=41, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('10.20.0.10', 46502), raddr=('74.125.124.95', 443)>"), '/home/travis/miniconda3/envs/pandas-dev/lib/python3.7/site-packages/bs4/builder/_html5lib.py', 335), ('ResourceWarning', ResourceWarning("unclosed <ssl.SSLSocket fd=15, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('10.20.0.10', 43640), raddr=('172.217.212.95', 443)>"), '/home/travis/miniconda3/envs/pandas-dev/lib/python3.7/site-packages/bs4/builder/_html5lib.py', 335)]

../../../miniconda3/envs/pandas-dev/lib/python3.7/contextlib.py:119: AssertionError
@jorisvandenbossche jorisvandenbossche added Testing pandas testing functions or related to the test suite IO HTML read_html, to_html, Styler.apply, Styler.applymap labels Nov 11, 2020
@jbrockmendel
Copy link
Member

td.check_file_leaks should identify where the socket is being leaked from

@simonjayhawkins
Copy link
Member

duplicate of #36467. one should be closed.

@jorisvandenbossche jorisvandenbossche added the Duplicate Report Duplicate issue or pull request label Nov 12, 2020
@jorisvandenbossche
Copy link
Member Author

@simonjayhawkins thanks for that link! I might have fixed it in #37786

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate Report Duplicate issue or pull request IO HTML read_html, to_html, Styler.apply, Styler.applymap Testing pandas testing functions or related to the test suite
Projects
None yet
Development

No branches or pull requests

3 participants