Skip to content

Commit 30ec1e9

Browse files
committed
Update profile.profile_path to the actual path
Previously it was keeping the default: profile_path: ~/.openinterpreter\default_profile.py because interpreter.profile_path is not an attribute that would be set within the profile file, but is a property *of* that file.
1 parent 64530cb commit 30ec1e9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

interpreter/profiles.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def __init__(self):
6969
# Debug settings
7070
self.debug = False # Whether to enable debug mode
7171

72-
# Set default path but don't load from it
72+
# Initialize with default path (which may be overridden in from_file)
7373
self.profile_path = self.DEFAULT_PROFILE_PATH
7474

7575
def to_dict(self):
@@ -136,6 +136,9 @@ def load(self, path):
136136
):
137137
return
138138
raise FileNotFoundError(f"Profile file not found at {path}")
139+
else:
140+
# Update profile_path when loading succeeds
141+
self.profile_path = os.path.abspath(path)
139142

140143
# Create a temporary namespace to execute the profile in
141144
namespace = {}
@@ -171,4 +174,6 @@ def from_file(cls, path):
171174
"""Create a new profile instance from a file"""
172175
profile = cls()
173176
profile.load(path)
177+
# Update profile_path after successful load
178+
profile.profile_path = os.path.abspath(os.path.expanduser(path))
174179
return profile

0 commit comments

Comments
 (0)