MyST-NB icon indicating copy to clipboard operation
MyST-NB copied to clipboard

Path().resolve() causes issues with relpath in Windows under network drives

Open davibicudo opened this issue 4 years ago • 2 comments

Hello

I'm having an issue when running under a network drive in Windows. Apparently relpath is not able to find a relative path between the network share (as returned by Path().resolve()) and a drive letter (even though that letter is mapped to the share). Source: https://stackoverflow.com/a/40997726/4187668

My suggestion is to replace it with Path().absolute(), which returns the absolute path but does not replace drive letters. An issue in SO points drawbacks to absolute(), but also another clear alternative with Path.cwd(): https://stackoverflow.com/a/44569249/4187668

Where this happens: https://github.com/executablebooks/MyST-NB/blob/e39132e4f1c58352a9f6d3004c7336dbbeca4e8a/myst_nb/execution.py#L171

davibicudo avatar Jul 01 '21 14:07 davibicudo

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

welcome[bot] avatar Jul 01 '21 14:07 welcome[bot]

Running another test I noticed that when running conversion with the target path in a different drive the same issue happens, i.e.: ValueError: path is on mount 'C:', start on mount 'Z:'

davibicudo avatar Jul 01 '21 16:07 davibicudo