JetBrains / intellij-micropython

Plugin for MicroPython devices in PyCharm and IntelliJ
https://plugins.jetbrains.com/plugin/9777-micropython
Apache License 2.0
514 stars 107 forks source link

Failure writing files to target subdirectories from Windows OS #82

Closed luisvgo closed 4 years ago

luisvgo commented 5 years ago

Flashing a Pycharm project with multiple subdirectories. Flashing fails writing subdirs content due to OSError: [Errno 2] ENOENT :

    ...
    raise PyboardError('exception', ret, ret_err)
    ampy.pyboard.PyboardError: ('exception', b'', b'Traceback (most recent call last):\r\n  File "<stdin>", line 1, in <module>\r\nOSError: [Errno 2] ENOENT\r\n')

setup:

microupload.py, receives path strings. When the string path has subdirs, a back-slash ('\') separator is seen in Windows. The path is not created in the target if this is the case.. Replacing the separator to use posix paths solves the issue,

Proposed solution in PR #86. Note: only tested with the mentioned setup

vlasovskikh commented 4 years ago

Merged #86 by @luisvgo.