Fix crashes and on Windows with files across multiple drives/paths #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fantastic IDE, thank you! :)
I have fixed some bugs found on Windows when working across different drives and paths. The program assumes the working directory will be on the same drive etc which makes the DownLoadAndRun functionality break (silently).
I have fixed this with a few small changes and it now works OK for me. After fixing this I found a few similar issues with the ctrl.py file where it had to strip off the drive letter properly otherwise it sent D:/ to micropython in run commands etc which failed.
These changes should work across *nix and Windows but I have only tested them on Windows.
Original error with prints on the input paths to show why it was breaking, with 'z' being the username:
pcOpenFile:D:/ds18b20test.py
convert D:/ds18b20test.py
0
ds18b20test.py
D:/ds18b20test.py
cmd=uitouart:::�
Traceback (most recent call last):
File "C:\gitsrc\uPyCraft_src\uPyCraft.py", line 1492, in slotDownloadFileAndRun
if self.slotDownloadFile():
File "C:\gitsrc\uPyCraft_src\uPyCraft.py", line 1479, in slotDownloadFile
myfile=open(str(rootDirectoryPath+afile[1:]),'w',encoding='utf-8')
OSError: [Errno 22] Invalid argument: 'C:/Users/z:/ds18b20test.py'
-1