diff --git a/spyder/plugins/projects/api.py b/spyder/plugins/projects/api.py index 4983a6ce405..5ff412835f1 100644 --- a/spyder/plugins/projects/api.py +++ b/spyder/plugins/projects/api.py @@ -84,7 +84,16 @@ def set_recent_files(self, recent_files): def get_recent_files(self): """Return a list of files opened by the project.""" - recent_files = self.get_option("recent_files", default=[]) + + # Check if recent_files in [main] (Spyder 4) + recent_files = self.get_option("recent_files", 'main', []) + if recent_files: + # Move to [workspace] (Spyder 5) + self.config.remove_option('main', 'recent_files') + self.set_recent_files(recent_files) + else: + recent_files = self.get_option("recent_files", default=[]) + recent_files = [recent_file if os.path.isabs(recent_file) else os.path.join(self.root_path, recent_file) for recent_file in recent_files]