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

ResourceWarning (unclosed socket) in safety v.2.3.1 #422

Closed
Peterl777 opened this issue Nov 9, 2022 · 1 comment · Fixed by #429
Closed

ResourceWarning (unclosed socket) in safety v.2.3.1 #422

Peterl777 opened this issue Nov 9, 2022 · 1 comment · Fixed by #429
Assignees
Labels

Comments

@Peterl777
Copy link

  • safety version: v2.3.1
  • Python version: v3.11.0
  • Operating System: Win 10 Home 22H2 19045.2251

Description

When I run safety check, the program runs normally. At the end of the run, Python emits the error:
sys:1: ResourceWarning: unclosed <ssl.SSLSocket fd=704, family=23, type=1, proto=0, laddr=('2001:8003:2c1c:8a0<snip>', 54722, 0, 0), > raddr=('2600:9000:<snip>', 443, 0, 0)>

IMPORTANT NOTE: I have all Python warnings turned on. These are not turned on by default.(I have some experience with Python warnings).

C:\Users\PeterL777> echo %PYTHONWARNINGS%
a

What I Did

C:\Users\PeterL777> safety check
+========================================================================================================+

                               /$$$$$$            /$$
                              /$$__  $$          | $$
           /$$$$$$$  /$$$$$$ | $$  \__//$$$$$$  /$$$$$$   /$$   /$$
          /$$_____/ |____  $$| $$$$   /$$__  $$|_  $$_/  | $$  | $$
         |  $$$$$$   /$$$$$$$| $$_/  | $$$$$$$$  | $$    | $$  | $$
          \____  $$ /$$__  $$| $$    | $$_____/  | $$ /$$| $$  | $$
          /$$$$$$$/|  $$$$$$$| $$    |  $$$$$$$  |  $$$$/|  $$$$$$$
         |_______/  \_______/|__/     \_______/   \___/   \____  $$
                                                          /$$  | $$
                                                         |  $$$$$$/
  by pyup.io                                              \______/

+========================================================================================================+

 REPORT

  You are using Safety's free vulnerability database. This data is outdated, limited, and
  licensed for non-commercial use only.
  All commercial projects must sign up and get an API key at https://pyup.io

  Safety v2.3.1 is scanning for Vulnerabilities...
  Scanning dependencies in your environment:

  -> c:\users\peter\appdata\local\programs\python\python311\lib\site-packages

  Using non-commercial database
  Found and scanned 44 packages
  Timestamp 2022-11-09 16:18:34
  0 vulnerabilities found
  0 vulnerabilities ignored
+========================================================================================================+

 No known security vulnerabilities found.

+========================================================================================================+

  You are using Safety's free vulnerability database. This data is outdated, limited, and
  licensed for non-commercial use only.
  All commercial projects must sign up and get an API key at https://pyup.io

+========================================================================================================+
sys:1: ResourceWarning: unclosed <ssl.SSLSocket fd=704, family=23, type=1, proto=0, laddr=('2001:8003:2c1c:8a00:ed17:<snip>', 54722, 0, 0), raddr=('2600:9000:209a:5200:10:<snip>', 443, 0, 0)>

I haven't checked the code, but looks like there's an unclosed socket there. Coming from Requests? Session object not closed?

@Peterl777
Copy link
Author

Thanks @yeisonvargasf !

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

Successfully merging a pull request may close this issue.

2 participants