-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed Spacing in Path Bug on Windows #41
base: main
Are you sure you want to change the base?
Conversation
Hello @TitusSmith33 can you please move this PR forward through the review process? We need to get a review from one student technical leader and from two students who did not work on the fix. Thanks, I appreciate your contribution and your work in moving this PR through the process. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested it out on MacOS and it's all good! I added a space in a solution repo and did not get a stack trace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got it to run on linux. I added a space and there was no error for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
execexam/main.py
Outdated
@@ -285,7 +285,7 @@ def run( # noqa: PLR0913, PLR0915 | |||
# build the command for running symbex; this tool can | |||
# perform static analysis of Python source code and | |||
# extract the code of a function inside of a file | |||
command = f"symbex {test_name} -f {failing_test_path}" | |||
command = f'symbex {test_name}" -f "{failing_test_path}"' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There’s a minor syntax issue in the command string. It appears that a double quote is missing at the beginning of {test_name}. The corrected line should be:
command = f'symbex "{test_name}" -f "{failing_test_path}"'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It worked for me on Windows 10! LGTM
Hello @TitusSmith33 will you need to update your pyproject.toml file? |
Pull Request
Contributors: Titus Smith
This PR is aimed at fixing Issue #36, which causes a stack trace on Windows 11 when running
execexam
if a space exists anywhere in the directory path.This PR simply changes 1 line that is passed in
main.py
ofexecexam
when the path to a failing check is passed. Symbax previously handled paths separately if there was a space anywhere in the directory. For example, if you had the following path:user/documents/software engineering/exam_solution
the program was splitting the path and trying to handle them one at a time rather than as one. This PR makes sure the failing path is quoted properly so that paths are handled as one, regardless of whether a space exists.This PR should not affect code coverage.
This PR was created and tested on a Windows 11 OS. I have tested this new implementation with a space in my path, and with no spaces in my path, and they both pass without causing a stack trace anymore.
Below is line 288 of
main.py
, which is where I changed how paths are handled: