Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data(contentsOf:) regression on Windows in Swift 5.10 #4921

Open
tishin opened this issue Mar 10, 2024 · 0 comments
Open

Data(contentsOf:) regression on Windows in Swift 5.10 #4921

tishin opened this issue Mar 10, 2024 · 0 comments

Comments

@tishin
Copy link

tishin commented Mar 10, 2024

A simple script to reproduce the issue:

import Foundation

let url = URL(fileURLWithPath: "/Projects/file.txt")
if FileManager.default.fileExists(atPath: url.path) {
    print(try Data(contentsOf: url))
}

It works in Swift 5.9.2 release, but throws an error in Swift 5.10 release:

Swift/ErrorType.swift:200: Fatal error: Error raised at top level: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"
Current stack trace:
0    (null)                             0x00007ffca6a24ae0 swift_stdlib_reportFatalErrorInFile + 132

Swift version 5.10 (swift-5.10-RELEASE)
Target: x86_64-unknown-windows-msvc
OS Version: 10.0.19045 N/A Build 19045

Possibly introduced by #4802

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant