Open benoitbenoit opened 6 months ago
Hey @benoitbenoit, thanks for reporting. The Linux packages provided by Anaconda are not very good, so please try with the Conda-forge ones (a set of community-maintained packages) to see if they solve the problem for you.
For that, please open a terminal and run there
conda create -n spyder-env -c conda-forge spyder python=3.10
conda activate spyder-env
spyder
If you need to work with the other Python libraries besides the ones that come with Spyder (e.g. Pandas), you need to install them in that new environment as well. For that you need to run
conda activate spyder-env
conda install -c conda-forge pandas
Let us know if that works for you.
Thank you for your reply. However, it did not solve the issue. I still have segfault few times a day.
Note that just before crashing, a pop-up window tells me that the file has been modified elsewhere and asks to recover it. I click cancel and then it crashes (sometimes it doesn't crash, it is really random). This is weird since the file is only opened in Spyder. Could this be the cause of the bug ?
Thank you again, Best
Thanks for the extra info @benoitbenoit. Is your home mounted in an NFS filesystem or something similar?
Thank you for your response, You are right, my scripts are stored on a server mounted with CIFS. Could this be source of the problem ? Thank you,
Yeah, I think it could be. We try to detect if a file has changed by reading its timestamp on disk, which I guess is handled differently by network filesystems than regular ones.
The only thing I can think of to fix this is to give users an option to disable that check instead of enforcing it automatically. But that is not a simple task, so I'm afraid we'll have to leave it for 6.1.0, to be released during the second half of the year. And there's no simple workaround to avoid it in the meantime, sorry.
Thank you. Best
Hi, we can confirm the issue on Debian KDE Clients, where the home directories are mounted using CIFS. It causes a lot of annoyance in our programming classes. A fix is strongly appreciated. Let us know if we can provide any help/testing Many thanks for spyder and all your work!
@benoitbenoit we give this patch a try:
+--- /usr/lib/python3/dist-packages/spyder/plugins/editor/widgets/editor.py 2024-06-20 07:16:54.096395325 +0200
++++ /usr/lib/python3/dist-packages/spyder/plugins/editor/widgets/editor.py 2024-06-20 14:39:07.693577124 +0200
+@@ -2370,15 +2370,16 @@
+ else:
+ # Else, testing if it has been modified elsewhere:
+ lastm = QFileInfo(finfo.filename).lastModified()
+- if to_text_string(lastm.toString()) \
+- != to_text_string(finfo.lastmodified.toString()):
++ dt = finfo.lastmodified.msecsTo(lastm)
++ if dt > 1000:
+ if finfo.editor.document().isModified():
+ self.msgbox = QMessageBox(
+ QMessageBox.Question,
+ self.title,
+- _("<b>%s</b> has been modified outside Spyder."
++ _("It looks like <b>%s</b> has been modified "
++ "outside Spyder. The working copy is from %i milliseconds ago."
+ "<br>Do you want to reload it and lose all "
+- "your changes?") % name,
++ "your changes?") % (name, dt),
+ QMessageBox.Yes | QMessageBox.No,
+ self)
+ answer = self.msgbox.exec_()
@and1bm, thanks for the patch. Could you submit a pull request to give you feedback about it?
If you have time for that, don't forget to read our Contributing guide before doing it.
Hi @ccordoba12 , not sure if this is more than a workaround. However, we will see if the problem described in this issue is fixed for us next week. Current master seems to have switched to another editor anyway.
Ok, please let us know if it works. I already left a review in your pull request if that's true.
Many thanks, this edit solved the issue.
I still sometimes get this error message: _The file xxxxx.py has been modified outside Spyder. Do you want to reload it and lose all your changes? Yes/No But Spyder no longer crashes when I select 'No'
Thank you again
Description
What steps will reproduce the problem?
seg fault appears roughly 10 times a day during file edition. No idea why. I am using ubuntu 20.04. I am unable to find an issue. Thank you if you can.
Traceback
Versions
Dependencies