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

For the 2nd run, warnings.simplefilter('error')and warnings.warn() doesn't raise a warning and the program is running forever(never stops) #4911

Open
hyperkai opened this issue Oct 20, 2024 · 1 comment

Comments

@hyperkai
Copy link

For the 1st run, warnings.simplefilter() with 'error' and warnings.warn() work as shown below:

import warnings

warnings.simplefilter('error')

warnings.warn("Warning 1") # UserWarning: Warning 1

But for the 2nd run, warnings.simplefilter() with 'error' and warnings.warn() doesn't raise a warning and the program is running forever(never stops) as shown below. *It doesn't occur in JupyterLab:

import warnings

warnings.simplefilter('error')

warnings.warn("Warning 1") # A warning is not shown and the program is running forever(never stops)
@hyperkai hyperkai added the bug label Oct 20, 2024
@hyperkai hyperkai changed the title For the 2nd run, warnings.simplefilter() with 'error' and warnings.warn() doesn't raise a warning and the program is running forever(never stops) For the 2nd run, warnings.simplefilter('error')and warnings.warn() doesn't raise a warning and the program is running forever(never stops) Oct 20, 2024
@cperry-goog
Copy link

What a great find, thanks. Tracking internally at b/376756650

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

No branches or pull requests

2 participants