Fix RecursionError when iterating streams by eric-wieser · Pull Request #1554 · gitpython-developers/GitPython

Conversation

@eric-wieser

next(self) was previously just a recursive call that does nothing.

This now implements __next__ using the actual implementation, and lets the python2-compatibility next() just wrap it.

@Byron

Thanks a lot, I have a feeling that this issue was present for a long time already!

Do you think Python 2 compatibility is still required? Support for it was dropped a while ago and if you agree it can be dropped entirely.

@eric-wieser

I have no objection to dropping the next method entirely; I left it only for the sake of being conservative.

eric-wieser

Comment on lines +704 to +705

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to commit through the github UI if you want to drop this Python2 compatibility layer entirely:

Note that there may be some downstream code that relies on using next because __next__ was broken though!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, right. Oh well, let's be conservative then.

@Byron

Great! Let's do that and the PR can be merged. Thank you

2 participants

@eric-wieser @Byron