← index #9286PR #11717
Off-topic · high · value 1.187
QUERY · ISSUE

windows: os.sep should be backslash

openby jimmoopened 2022-09-12updated 2022-09-15
enhancement

This came up in https://github.com/micropython/micropython-lib/pull/527, and we have a workaround there, but getting this right will be required to make os.path work correctly.

The windows port current returns / from os.sep but should be \. We should fix that, as well as implementing os.altsep for unix/windows (return None on unix, / on windows).

CANDIDATE · PULL REQUEST

windows/msvc/paths.props: Dont add variant path for mpy-cross build.

openby jimmoopened 2023-06-06updated 2023-11-09
port-windows

If you try and build mpy-cross.vcxproj from Visual Studio (tested both 2017 and 2022), it expected the PyVariant property to be set, and without it ends up with an invalid include path, which results in a double-backslash in the cl.exe command line.

Same goes for using msbuild. It's easy to add /p:PyVariant=standard there but it should not be necessary.

paths.props is shared by mpy-cross.vcxproj, but in the mpy-cross build, PyVariant will be not set (because common.props explicitly doesn't set it when building mpy-cross).

However, paths.props will attempt to default PyVariantDir to variants\$(PyVariant)\ which will end up as variants\\ and the double backslash breaks the cl.exe command line.

This appears to work, but I wonder if all uses of PyVariantDir should also now have a Condition added?

cc @stinos

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied