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

Clean up allocated TLS socket @ PyPI filter #226

Closed
wants to merge 1 commit into from

Commits on Aug 19, 2024

  1. Clean up allocated TLS socket @ PyPI filter

    Invoking `python -Werror -m sphinx -b spelling ...` surfaces a resource warning related to not releasing the TLS socket that `xmlrpc.client.ServerProxy()` opens. There's no explicit mention of a cleanup method in the stdlib docs but there's one example with a context manager. I inspected the source code and it seems like we should either use a CM or a rather weird callable interface (`xmlrpc.client.ServerProxy()('close')()`). I opted for a CM.
    
    ```python-traceback
    [...]
    Ignoring wiki words
    Ignoring acronyms
    Adding package names from PyPI to local dictionary…
    Exception ignored in: <ssl.SSLSocket fd=3, family=2, type=1, proto=6, laddr=('192.168.1.114', 53560), raddr=('146.75.120.223', 443)>
    Traceback (most recent call last):
      File "~/src/github/a/project/.tox/build-docs/lib/python3.12/site-packages/sphinxcontrib/spelling/builder.py", line 65, in init
        f.append(filters.PyPIFilterFactory())
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ResourceWarning: unclosed <ssl.SSLSocket fd=3, family=2, type=1, proto=6, laddr=('192.168.1.114', 53560), raddr=('146.75.120.223', 443)>
    Ignoring Python builtins
    Ignoring importable module names
    Ignoring contributor names
    [...]
    ```
    
    ## Disclaimer
    
    This patch is coded in-browser on the GH UI w/ no testing. It might need some love and/or tests.
    webknjaz authored Aug 19, 2024
    Configuration menu
    Copy the full SHA
    f3a490e View commit details
    Browse the repository at this point in the history