JordanLeich / Ultimate-Calculator

This is an incredibly powerful calculator and converter that is capable of many useful day-to-day functions that typical calculators cannot perform.
MIT License
43 stars 10 forks source link

Bug Reporting 🐞 #7

Open JordanLeich opened 3 years ago

JordanLeich commented 3 years ago

Reporting Bugs ❗

Known Bugs 🐛

  1. For developers of this project, if you run the project through any other file than main.py and you try to use the restart or quit option, you will raise an error. This error will likely be avoided since normal end-users will not see this error due to them running the project through main.py.
PeanutbutterWarrior commented 3 years ago

The basic calculation doesn't let you use brackets or follow operator precedence. I'd suggest taking a input for the whole calculation and calling eval on it. Eval does raise a risk of arbitrary code execution, but since this is only a local project it does not matter, and if it does then a regex could be run against it to only allow sensible characters. You could otherwise write a custom parser, but this is quite involved and unnecessary when python offers eval.

bot-coder05 commented 3 years ago

@PeanutbutterWarrior Completely removed the calculator function and replaced them with eval(), same with the gui version.

bot-coder05 commented 3 years ago

Restarting the application from places other than main crashes. The cause might because main imports files where it's unknown to the file that restart is being called from.

JordanLeich commented 3 years ago

@bot-coder05 With my version of the project, I'm not having any issues with restarting the program from other files than the main.py file, check to see if your version is the most up-to-date or try deleting the project from your computer and then git pull from the project.

bot-coder05 commented 3 years ago

@JordanLeich hmmm. If I run the calculators.py directly and not from main, when I choose to restart it gives an error ModuleNotFoundError: No module named 'calculators.calculators'; 'calculators' is not a package

JordanLeich commented 3 years ago

@bot-coder05 I was able to find the exact error you were talking but unfortunately, I'm not sure how to fix it, I've tried changing around the imports in the restart file but nothing works. Ideally, an end-user would not be running the project from any other file than the main.py file so they would not be capable of seeing this error message.

bot-coder05 commented 3 years ago

@JordanLeich

Ideally, an end-user would not be running the project from any other file than the main.py file so they would not be capable of seeing this error message.

I agree, it might be a mild inconvenience to developers though. We can ignore it for now as it's not affecting anyone

mbcalli commented 3 years ago

> python3 main.py

Traceback (most recent call last):
  File "~/Ultimate-Calculator/conversions/conversions.py", line 2, in <module>
    import winsound
ModuleNotFoundError: No module named 'winsound'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "~/Ultimate-Calculator/main.py", line 9, in <module>
    import conversions.conversions
  File "~/Ultimate-Calculator/conversions/conversions.py", line 5, in <module>
    import winsound
ModuleNotFoundError: No module named 'winsound'

Running on MacOs.

JordanLeich commented 3 years ago

@mbcalli Thanks for reaching out about this, I just fixed this error message for you.

mbcalli commented 3 years ago

@mbcalli Thanks for reaching out about this, I just fixed this error message for you.

Yes, fixed. Thank you.

ShawnDriscoll commented 2 years ago

When running main.exe: NameError: name 'exit' is not defined in "gui.py" line 81

Happens after choosing option 3.

JordanLeich commented 2 years ago

When running main.exe:

NameError: name 'exit' is not defined in "gui.py" line 81

Happens after choosing option 3.

I will look into this error.

JordanLeich commented 2 years ago

@ShawnDriscoll I have fixed the exit bug but please avoid using the GUI application while running the main.exe version since the GUI seems to be incompatible with how the main.exe file is created.