Skip to content

fix: Remove global warning format side effect#5481

Open
emmanuel-ferdman wants to merge 1 commit intoplotly:mainfrom
emmanuel-ferdman:fix-warnings-format
Open

fix: Remove global warning format side effect#5481
emmanuel-ferdman wants to merge 1 commit intoplotly:mainfrom
emmanuel-ferdman:fix-warnings-format

Conversation

@emmanuel-ferdman
Copy link

Code PR

  • I have read through the contributing notes and understand the structure of the package.
  • I have added tests or modified existing tests.
  • For a new feature, I have added documentation examples (please see the doc checklist as well).
  • I have added a CHANGELOG entry if changing anything substantial.
  • For a new feature or a change in behavior, I have updated the relevant docstrings in the code.

Summary

Importing plotly.tools or plotly.offline overwrites Python's global warnings.formatwarning. This changes how all warnings look, not just plotly's. Breaks output for user code and other libraries. The custom format was added in 2014 for cosmetic reasons but the global side effect was unintended. This PR removes it because Python's default format works.

Fixes #5472
Fixes #3872

Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: plotly breaks warnings format Importing plotly.tools changes warnings.formatwarning as a side effect

1 participant