MLD303: Literal asset path syntax does not match the profile platform¶
qual reports MLD303 when a literal path passed to
SVGMobject() / ImageMobject() uses path syntax of a different
platform than a render profile targets:
- a Windows drive prefix (
C:...) or backslash separators under a profile withplatform = "linux"/"macos"; -
a POSIX absolute path (leading
/) underplatform = "windows". -
Default severity:
warning - Minimum confidence:
high - Implementation phase:
4 - Fix: none
On POSIX platforms a backslash is an ordinary file-name character, so a
Windows-style path is one (wrong) file name and the asset lookup fails at
render time. On Windows a leading / is rooted but drive-less: it
resolves against the current drive of the render process, not the POSIX
location it was written for. The diagnostic lists exactly the profiles
whose platform mismatches (applicable_profiles).
MLR104 treats foreign-platform syntax as unverifiable and stays silent,
so the two rules do not overlap on this territory. Non-literal paths stay
silent, and relative forward-slash paths are accepted everywhere (Windows
accepts / as a separator).
Wrong:
SVGMobject("C:\\assets\\logo.svg") # linux/macos profile target
ImageMobject("/home/me/photo.png") # windows profile target
Right: