Skip to content

resolving SimConfig.save crash#882

Open
abhinavascends wants to merge 1 commit intosuny-downstate-medical-center:developmentfrom
abhinavascends:simconfig-save-logic
Open

resolving SimConfig.save crash#882
abhinavascends wants to merge 1 commit intosuny-downstate-medical-center:developmentfrom
abhinavascends:simconfig-save-logic

Conversation

@abhinavascends
Copy link
Copy Markdown
Contributor

Hii @jchen6727 , I saw the issue here- SimConfig.save() crashes when provided with a simple filename (e.g., 'cfg.json') instead of a full absolute path.

As the crash in SimConfig.save() was happening because the original logic relied on finding a directory separator that isn't there for local filenames,here I used os.path.splitext() to handle the extension parsing instead. It safely grabs the extension even when there's no directory path provided, which was the main point of failure.

Did these 2 changes :

  1. Switched to os.path.dirname() for the folder path.
  2. Used _, ext = os.path.splitext(filename) to correctly unpack the root and extension.

@abhinavascends abhinavascends mentioned this pull request Jan 9, 2026
@abhinavascends
Copy link
Copy Markdown
Contributor Author

Hey there @jchen6727 , I hope you would look onto the PR and give your valuable inputs on this.

@vvbragin
Copy link
Copy Markdown
Collaborator

vvbragin commented Feb 2, 2026

hi @abhinavascends , thank you for your contribution! We are currently refactoring this broader functionality, which includes the given method. We’ll make sure to consider your suggestion in the final version. Thanks again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants