Path returned by Bundle.module.path(forResource:ofType:)
on Windows is incorrect
#8264
Open
1 task done
Labels
Is it reproducible with SwiftPM command-line tools:
swift build
,swift test
,swift package
etc?swift build
,swift test
,swift package
etc.Description
When calling
Bundle.module.path(forResource:ofType:)
on Windows the path returned has an additional '/' prefixed to the file name.Expected behavior
Path returned by
Bundle.module.path(forResource:ofType:)
does not return a path starting with/
.Actual behavior
Path returned by
Bundle.module.path(forResource:ofType:)
starts with a/
.This is most likely caused by the URLs that
Bundle
generates which include three forward slashes.Steps to reproduce
I found this issue while trying to load resources in a test target.
Swift Package Manager version/commit hash
No response
Swift & OS version (output of
swift --version ; uname -a
)Swift version 6.0 (swift-6.0-RELEASE)
Target: x86_64-unknown-windows-msvc
The text was updated successfully, but these errors were encountered: