-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
On macOS "Save as..." always defaults to saving with ".R" extension rather than ".py" #22248
Comments
I'm also having this issue, and I'm not able to fix it. Do you know what the file name in config is that needs to be edited to fix it? |
I'm probably being dumb but I can't find that file in any of the system folders, and then I tried saving the file with the changes and spyder still saves as .py.R |
What do you mean you can't find the file but you saved it with the changes? |
I downloaded it from GitHub and saved it into the config folder. There wasn't an existing file called utilis.py if there was supposed to be one. |
Hi @alishaexe In case you are still facing the issue. |
It may be unrelated, but for the opening dialog, the default in Edit: Actually, I can see |
Hey everyone, thanks for the feedback! We'll take a look at this one for 5.5.6, to be released shortly. |
@mrclary, could you take a look at this one? It doesn't seem to hard to fix and only affects Mac users. |
I would guess that #22248 (comment) is related; I've noticed this as well, but haven't yet taken the time to track down when this first manifested. I'm wondering if this could be related to Qt. Nevertheless, I'll investigate further and see what I find. |
Is the issue resolved? Any updates? Can I use Spyder allowing the .R extension to normally write and run python files in the meantime? |
@AbhilashAradhya, I've submitted a PR that should resolve this issue for Spyder 5.5.6. Until then, you will need to explicitly select the "All files" option at the bottom of the file filter dropdown menu and manually type the I think this issue may have been introduced with the update from PyQt 5.12 to 5.15. |
Issue Report Checklist
conda update spyder
(orpip
, if not using Anaconda)jupyter qtconsole
(if console-related)spyder --reset
Problem Description
Every time I save a file, it always defaults to saving it as .R rather than .py, even though .py is the first extension in the filter being passed to Qt.
What steps reproduce the problem?
What is the expected output? What do you see instead?
It should save as .py by default particularly if the existing file name is already .py
Thanks Mike, Is There A One-Line Solution?
There sure is! Look here on Line 133:
https://github.com/spyder-ide/spyder/blob/bb6d9301c9356162970e9ea7043bd4287e1ddb5b/spyder/config/utils.py#L119C1-L133C45
Change this
to this:
This solves the problem. For whatever reason, on Mac, it seems to read the second extension as default, maybe because it expects the first to be
*.*
or something. Not sure if the same behavior on all platforms - if so, you may want to do this only if it's Mac.Versions
Spyder 5.5.5
Python 3.11.9 64-bit | Qt 5.15.8 | PyQt5 5.15.9 | macOS 14.5 (arm64)
Dependencies
The text was updated successfully, but these errors were encountered: