Skip to content

itertools issue when saving animations #8973

Closed

Description

@braaannigan

Bug report

Itertools is generating errors in animation.py when saving animations

There is a call to itertools.islice when writing animations. With python 3.6 and matplotlib 2.0.2 this gives an error when the stop argument is of type np.int64 but works fine when the type is int. I'll report this as an issue with itertools well.

The error arises when this code is used (cf line 1553 in animation.new_saved_frame_seq() ):
itertools.islice( [3, 4, 5], np.int64(2) )
but not with this
itertools.islice([3,4,5], 2)

A workaround is to add the following line at the start of animation.new_saved_frame_seq():
self.save_count = int(self.save_count)

Matplotlib version

  • Operating System: Ubuntu 14.04
  • Matplotlib Version: 2.0.2
  • Python Version: 3.6.2

Installed from conda

Activity

  1. braaannigan commented on Aug 1, 2017

    @braaannigan
    ContributorAuthor

    I created a report for this here:
    http://bugs.python.org/issue31097

    It turns out to be a known bug - see here http://bugs.python.org/issue30537

    Any objections to me preparing a PR with the workaround above? Just for clarity, am proposing adding: self.save_count = int(self.save_count)

  2. anntzer commented on Aug 1, 2017

    @anntzer
    Contributor

    Go for it. Please add a link to the CPython bug as a comment next to the relevant line.

  3. modified the milestones: , on Aug 1, 2017
  4. dopplershift commented on Aug 2, 2017

    @dopplershift
    Contributor

    I'd merge the PR. Thanks for offering to make it!

  5. tacaswell commented on Aug 13, 2017

    @tacaswell
    Member

    Closed by #8984

  6. modified the milestones: , on Aug 13, 2017
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions