forked from mu-editor/mu
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
What were you trying to do?
Save file with custom extension, other than ".py"
What steps did you take to trigger the issue?
Double click on file tab to perform a "save file as".
What did you expect to happen?
Save file with custom extension, other than ".py"
What actually happened?
Mu forces ".py" extension on the file, even if file pattern/filter is "Others (.)"
Operating System Version
macOS 12.6.2
Mu Version
1.2.1
Other Info
Follow
- Double-click on Tab Doesn't Save Other (*.*) - it adds .py in Mac Mu 1.2.0, "Save" button does. mu-editor/mu#2382
Related to - Ensure, if no file extension provided, a .py one is used. mu-editor/mu#1572 and
- Update virtualenv dependency to a version packing pip v19.3 mu-editor/mu#1573
There are several snippets in both main.py and logic.py related to managing save filenames and managing/forcing extensions.
main.py : Windows.get_save_path():
# The file is not a . (dot) file and there's no extension, so add
# .py as default.
path += ".py"
logic.py: Editor.rename_tab():
if not self.has_python_extension(os.path.basename(new_path)):
# No extension given, default to .
new_path += ".pyl"
logic.py: Editor --> python_extensions defined in several places
self.python_extensions = [".py", ".pyw"]
and
pyextensions = [".pyw", ".PYW", ".py", ".PY"]
and
for mode_name, mode in self.modes.items():
if mode.file_extensions:
extensions += mode.file_extensions
Editor Log
No response
Metadata
Metadata
Assignees
Labels
No labels