Skip to content

hashindex: fix iterator implementation - #1659

Merged
enkore merged 1 commit into
borgbackup:1.0-maintfrom
ThomasWaldmann:fix-iterator
Sep 29, 2016
Merged

hashindex: fix iterator implementation#1659
enkore merged 1 commit into
borgbackup:1.0-maintfrom
ThomasWaldmann:fix-iterator

Conversation

@ThomasWaldmann

Copy link
Copy Markdown
Member

NSKeyIterator and ChunkKeyIterator raised StopIteration once only when they reached their end.

But they did not raise StopIteration if one called next() again after they were exhausted,
so they did not comply to the standard iterator protocol.

AFAIK, this did not cause actual problems due to the way these iterators are used,
but when I tried to use itertools.islice() to get n-long sequences from these iterators,
it failed / went into an endless loop.

NSKeyIterator and ChunkKeyIterator raised StopIteration once only when they reached their end.

But they did not raise StopIteration if one called next() again after they were exhausted,
so they did not comply to the standard iterator protocol.

AFAIK, this did not cause actual problems due to the way these iterators are used,
but when I tried to use itertools.islice() to get n-long sequences from these iterators,
it failed / went into an endless loop.
@ThomasWaldmann

Copy link
Copy Markdown
Member Author

@RonnyPfannschmidt this is why I couldn't get islice working. ^^^

@codecov-io

codecov-io commented Sep 29, 2016

Copy link
Copy Markdown

Current coverage is 81.90% (diff: 100%)

Merging #1659 into 1.0-maint will not change coverage

@@           1.0-maint      #1659   diff @@
===========================================
  Files             15         15          
  Lines           4780       4780          
  Methods            0          0          
  Messages           0          0          
  Branches         815        815          
===========================================
  Hits            3915       3915          
  Misses           631        631          
  Partials         234        234          

Powered by Codecov. Last update 4838b9e...8fd0e07

@RonnyPfannschmidt

Copy link
Copy Markdown
Contributor

Yelp

@enkore
enkore merged commit ab9d761 into borgbackup:1.0-maint Sep 29, 2016
@ThomasWaldmann
ThomasWaldmann deleted the fix-iterator branch September 29, 2016 10:52
@enkore enkore mentioned this pull request Sep 30, 2016
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.

4 participants