So, I'm working in this project with a professor. As of now, it encompasses several own-made packages and modules. I sent him a .rar file with the whole project for revision, which he readily opened up in his pc using Spyder (the same IDE I use). We jointly made some corrections to it over a videocall, after which he sent me the corrected file back (agin, a .rar file). Once I got, I unpacked it and tried to run it again in my pc (the whole folder is configured as a Spyder project folder, so I opened using the spyder "open project" functionality) and all files seemed to execute just fine except for one. I don't know why, but there is a file that won't just execute once I press the "run file" button. It only allows itself to be executed cell-wise by pressing the "run current cell and go to the next one button", after which it runs just fine. But, for some reason, trying to run the whole file raises the following error:
File "C:\Users\andre\AppData\Local\Temp/ipykernel_10380/4038856374.py", line 1, in <module>
runfile('C:/Users/andre/Desktop/Eafit/8vo Semestre/Monitoría Panel Solar/OptiSurf/Fitness_Function/fit_main.py', wdir='C:/Users/andre/Desktop/Eafit/8vo Semestre/Monitoría Panel Solar/OptiSurf/Fitness_Function')
File "C:\Users\andre\anaconda3\lib\site-packages\debugpy\_vendored\pydevd\_pydev_bundle\pydev_umd.py", line 167, in runfile
execfile(filename, namespace)
File "C:\Users\andre\anaconda3\lib\site-packages\debugpy\_vendored\pydevd\_pydev_imps\_pydev_execfile.py", line 20, in execfile
contents = stream.read()
File "C:\Users\andre\anaconda3\lib\codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 667: invalid continuation byte
I frankly don't know what it is. At the beginning I thought It may had been one of the packages that had been corrupted but commenting THE WHOLE FILE and running it, raises the exact same error (not to mention that the rest of modules I tried, seemed to work just fine). Then I thought that it may have had to do with the fact that I had two projects with the same name (since the uncorrected and unmodified copy of my project started also raising that exact same error in the exact same file), so I tried erasing each one once, but that didn't work. Finally, I tried erasing everything, creating a new spyder project and just pasting the folders in the new project, but no luck there either.
In summary, any insight would very much be appreciated.I have the feeling that file itself may have been corrupted? I mean, the error that it raises seems to indicate that file's name can't be decoded or something along those lines. If anyone has any suggestions, I'd love to hear them.
(Spyder maintainer here) I'm sorry for the inconveniences this could have caused you. This was a bug in Spyder and it was fixed in our 5.1.5 version.