Open
Description
If, on Windows, file path started with '/' char, then this process can be successfuly run on Dart 2.0 but produces an error on Dart 1.2x. Example is below
import "dart:io";
main() async {
String executable = Platform.resolvedExecutable;
String eScript = '/D:/DART/sdk/tests/co19/LibTest/io/Process/start_A01_t01_lib.dart';
await Process.run(executable, [eScript]).then((ProcessResult results) {
print(results.stderr);
});
print("DONE");
}
The program above works on Dart 2.0 but fails on Dart 1.24 with the following error
Unhandled exception:
Invalid argument(s): Illegal character in path
#0 _Uri._checkWindowsPathReservedCharacters (dart:core/uri.dart:1695)
#1 _Uri._makeWindowsFileUrl (dart:core/uri.dart:1784)
#2 new _Uri.file (dart:core/uri.dart:1663)
#3 _Platform._nativeScript= (dart:io-patch/platform_patch.dart:45)
For Windows, path '/D:/...' is wrong, but, for example, Platform.script.path
on Windows returns path in this format. See #31610