Skip to content
This repository was archived by the owner on Aug 9, 2025. It is now read-only.

fix: handle user-defined number of solutions (#18) #29

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

Ekleen123
Copy link

This pull request updates the search.py file to handle the user-defined number of solutions properly. The fix addresses the main logic but the issue with the out-of-range error still persists in some edge cases even after limiting the solutions to 3 instead of 10.
I also tried adding a try-except block to catch this error gracefully, but unfortunately, it did not resolve the problem fully.

Kindly review this change. I would appreciate any further suggestions or guidance to completely fix this problem.

Thank you for your time and review!

@SpaciousCoder78
Copy link
Owner

Thanks for the commit. I will check it when I have some free time and tell you the changes if any.

@SpaciousCoder78
Copy link
Owner

I’m a little occupied working on getting this project to Linux app stores. I will check your PR later this week.

Also dropping a star on this repo would be appreciated

@Lonelyguy123
Copy link

I'll be doing the code review on behalf of @SpaciousCoder78

@Ekleen123
Copy link
Author

Okay Thank You

@Lonelyguy123
Copy link

I've gone through it and the user defined number of solutions has been handled. Thank you for the pull request @Ekleen123. It is working fine but there is some internal problem with the library that is causing the list index out of range error. Lets say there are two solutions, it says solution 1, 2 and then we get the list index out of range error. It does eventually open the links but the error is still displayed. If possible, please try to fix it.

@SpaciousCoder78
Copy link
Owner

@Ekleen123 The issue seems to be with the library so we’ll work on a patch for it but for now as @Lonelyguy123 said, try to handle this ListIndexOutOfRange error via exception handling and try to see if you can display something like “End of solutions” other than the error message

@Lonelyguy123 will review your changes again once that’s done and if everything’s good we’ll merge the PR

@Ekleen123
Copy link
Author

I had tried placing the line
pyoverflow3.submit_error(str(stderr), num_solutions)
inside a try-except block to handle the list index out of range error, but it didn’t prevent the error from being printed. The exception still occurred before continuing to show the solutions, so the approach didnt fully resolve the issue as well

@SpaciousCoder78
Copy link
Owner

Yes, it seems like the core issue is in the downstream library that we are using, we will work on a fix for it. We will keep this PR open for now and inform you any changes that are necessary.

In the meantime, we have opened another issue #34 for testing and configuring software for Fedora and RHEL based distros.

You can comment on it if you'd like to work on it and I will assign it to you. I will credit you in the README.md's creditors section if that's done.

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.

3 participants