Fix crashes and on Windows with files across multiple drives/paths#4
Open
MarkSmithAU wants to merge 1 commit intoDFRobot:masterfrom
Open
Fix crashes and on Windows with files across multiple drives/paths#4MarkSmithAU wants to merge 1 commit intoDFRobot:masterfrom
MarkSmithAU wants to merge 1 commit intoDFRobot:masterfrom
Conversation
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
|
@MarkSmithAU The latest version is compatible with Windows and Linux, but for the lack of consideration in logic, it will lead to errors in disks except the C disk. This problem will be solved in the further uPyCaft and will be released together with the MAC version. Thanks for your attention. |
|
@MarkSmithAU It caused by rootDirectoryPath. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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