Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Avoid infinite recursions. #60

Closed
wants to merge 1 commit into from
Closed

Avoid infinite recursions. #60

wants to merge 1 commit into from

Conversation

regebro
Copy link

@regebro regebro commented Jun 4, 2014

Some frameworks (most notably Plone) tend to have modules that require each other. This leads to infinite recursions. This patch is one way to avoid them.

@brettcannon
Copy link
Owner

If you could add a test, Lennart, I will happily accept the patch.

@jezdez
Copy link
Contributor

jezdez commented Jun 5, 2014

Nice one, @regebro. I was about to file a bug titled "Stop melting my server" ;)

@regebro
Copy link
Author

regebro commented Jun 5, 2014

That was probably me. cough. I'll make a test as soon as I get time over.

@brettcannon
Copy link
Owner

At worst I will get to writing a test tomorrow so Jannis' melting servers shouldn't have to suffer for too long.

@brettcannon
Copy link
Owner

I had enough time to fix this on my own. Thanks for the bug report and initial stab at a patch, Lennart!

@regebro
Copy link
Author

regebro commented Jun 6, 2014

Thanks, and sorry for not having time to write a test. Busy week.

@brettcannon
Copy link
Owner

np about the test! I happened to have a slow week. Still appreciate the bug report and the initial stab at writing a patch.

@msabramo
Copy link
Contributor

@regebro et al: Can you provide an example of some packages, Plone packages or otherwise, with circular dependencies?

I discovered a similar infinite recursion bug in pipdeptree (see tox-dev/pipdeptree#10), but I discovered it with internal-only packages in a private package index -- I would like to find a test case with publicly available packages.

@regebro
Copy link
Author

regebro commented Jun 15, 2014

You can try with the package "plone".

caniusepython3 --projects plone

Will trigger the bug under caniusepython 2.1.1 but not in 2.1.2.

@msabramo
Copy link
Contributor

@regebro: Thanks!!

@msabramo
Copy link
Contributor

Hey folks, I just uploaded 2 packages with a circular dependency to PyPI so I could show a minimal case for reproducing a similar infinite recursion error in pipdeptree and so hopefully soon I can write a test to prove the fix I have.

I thought these might be useful to you if you wanted to go back and write a test.

https://github.com/msabramo/CircularDependencyA
https://github.com/msabramo/CircularDependencyB

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants