-
Notifications
You must be signed in to change notification settings - Fork 49
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 in signing API #549
Comments
Thanks @lukpueh! This looks like it's in our OAuth flow. |
I'm curious what you're expecting to happen here? Are you planning to run this test in an environment with ambient OIDC credentials? Otherwise calling |
Oh, this snippet is just a minimal local reproducer for your convenience. My test indeed uses ambient credentials: The related GitHub Action log also shows the resource warning: |
Got it, from that run it's just:
Given that |
Yes, that's the one I saw originally. And when I tried to reproduce locally, I got another one somewhere in |
I can't reproduce this. Can you call: import warnings
warnings.filterwarnings("error") at the top of your test case so we can get a stacktrace from these warnings instead? |
The full |
EDIT: I updated the list to only contain sigstore + dependencies from a regular pip install. I still get the same warnings.
|
lukpueh/securesystemslib@eb63de9 This doesn't seem to show the stacktrace of the warnings when run with unittest. |
Here's what happens when I run my snippet from above with python -Wdefault <<EOF
> import warnings
> warnings.filterwarnings("error")
> import io
> from sigstore.oidc import Issuer
> from sigstore.sign import Signer
> issuer = Issuer.production()
> token = issuer.identity_token()
> signer = Signer.production()
> result = signer.sign(io.BytesIO(b"DATA"), token)
> EOF
Waiting for browser interaction...
Exception ignored in: <socket.socket fd=8, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 61857)>
Traceback (most recent call last):
File "<stdin>", line 7, in <module>
ResourceWarning: unclosed <socket.socket fd=8, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 61857)>
Exception ignored in: <ssl.SSLSocket fd=9, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('192.168.0.154', 61865), raddr=('142.251.36.208', 443)>
ResourceWarning: unclosed <ssl.SSLSocket fd=9, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('192.168.0.154', 61865), raddr=('142.251.36.208', 443)> line 7 would be |
I looked into this a bit, and looks like the error is originating from the sigstore-python/sigstore/oidc.py Line 259 in fb2488e
Here is a related issue thread. My understanding is this is just a warning on unclosed resource. Based on this thread's history, I was not too sure what was the impact of this warning on @lukpueh 's side. If we really want to get rid of this warning, we can perhaps add destructor in |
Yeah, closing it with a destructor seems appropriate. However, I'm considering this very low priority, since my more immediate plan is to replace |
Description
Just noticed some resource warnings while unittesting. Here's a reproducer for bash on macOS:
Platform details:
$ sw_vers ProductName: macOS ProductVersion: 12.6.3 $ python --version Python 3.10.9 $ pip freeze | grep sigstore sigstore==1.1.1 sigstore-protobuf-specs==0.1.0
The text was updated successfully, but these errors were encountered: