Skip to content

deal with upcoming deprecations in CPython #25912

Closed

Description

@tacaswell
FAILED lib/matplotlib/tests/test_lines.py::test_set_line_coll_dash_image[svg] - matplotlib.testing.exceptions.ImageComparisonFailure: images not close (RMS 0.412):
FAILED lib/matplotlib/tests/test_backend_svg.py::test_url_tick - DeprecationWarning: datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.now(datetime.UTC).
FAILED lib/matplotlib/tests/test_backend_svg.py::test_svg_default_metadata - DeprecationWarning: datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.now(datetime.UTC).
FAILED lib/matplotlib/tests/test_backend_svg.py::test_svg_clear_default_metadata - DeprecationWarning: datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.now(datetime.UTC).

which was changed by python/cpython#103858

We appear to use this a couple of places in Matplotlib https://github.com/search?q=repo%3Amatplotlib%2Fmatplotlib%20utcfromtimestamp&type=code all of which need to be changed to not-deprecated methods of achieving the same thing.

I am labeling this as "good first issue" because there is no API design and there should be no behavior changes (other than not getting warnings) but "medium" difficulty as datetime and timezones are involved.

Activity

  1. added
    Difficulty: Medium
    🌱 Good first issue
    on May 18, 2023
  2. added this to the v3.7.2 milestone on May 18, 2023
  3. smeet07 commented on May 18, 2023

    @smeet07
    Contributor

    I'll open a pr , do I need to assign this issue or can I directly start working on the pr?

  4. QuLogic commented on May 19, 2023

    @QuLogic
    Member

    No, we do not assign issues. If there is no open PR linked here, you can just start working on it.

  5. ksunden commented on May 19, 2023

    @ksunden
    Member

    Do we have any sense of what is causing the image test failure? seems odd that that would be caused by the deprecation warning, but haven't looked into it at all.

  6. tacaswell commented on May 19, 2023

    @tacaswell
    MemberAuthor

    oh, I think I copied one too many lines, only meant to grab the deprecation warning lines here. I am seeing ~50 failures on my very unstable (default branch of almost everything) environment.

  7. changed the title [-]deal with upcoming depractions in CPython[/-] [+]deal with upcoming deprecations in CPython[/+] on May 19, 2023
  8. added a commit that references this issue on May 23, 2023
    6df1bb3
  9. added a commit that references this issue on Jun 5, 2023
    af49f2a
  10. added a commit that references this issue on Jun 15, 2023
    aa1b518
  11. added a commit that references this issue on Jun 22, 2023
    c6282ab
  12. added 4 commits that reference this issue on Apr 19, 2026
    0579a0b
    766b786
    0dca840
    db02e56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty: Medium🌱 Good first issue

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions