Skip to content

Unable to run Dart scripts if the SDK is in a folder with special characters (spaces?) (on Windows?) #61074

Closed

Description

@DanTup

I have my bleeding-edge SDK in a folder named "Latest (Bleeding Edge)" to try and catch bugs related to path encoding (something that has existed in both Dart-Code and other tools in the past).

Today I'm unable to run simple Dart scripts using the SDK in that folder:

Image

(Bleeding: Error: Error when reading '(Bleeding': The system cannot find the file specified.

My SDK version is:

PS D:\Dev\Google\dart-sdk\sdk\pkg\analysis_server> dart --version
Dart SDK version: 3.9.0-edge.d3c323e26d1663ab422ff89b65d5a78b0e89c997 (main) (Sun Jul 6 22:55:04 2025 -0700) on "windows_x64"

Activity

  1. DanTup commented on Jul 8, 2025

    @DanTup
    CollaboratorAuthor

    Seems to have happened somewhere between 3.9.0-300.0.dev (works) and 3.9.0-314.0.dev (does not work):

    PS D:\Dev\Google\dart-sdk\sdk\pkg\analysis_server\test\services\refactoring\legacy> & "D:\Tools\Dart\Test (Dev)\3.9.0-300.0.dev\dart-sdk\bin\dart.exe" foo.dart
    test
    PS D:\Dev\Google\dart-sdk\sdk\pkg\analysis_server\test\services\refactoring\legacy> & "D:\Tools\Dart\Test (Dev)\3.9.0-314.0.dev\dart-sdk\bin\dart.exe" foo.dart
    (Dev)/3.9.0-314.0.dev/dart-sdk/bin/dart.exe: Error: Error when reading '(Dev)/3.9.0-314.0.dev/dart-sdk/bin/dart.exe': The system cannot find the path specified.
    

    Commits between those versions are here: 3.9.0-300.0.dev...3.9.0-314.0.dev

    At a quick glance, the only commit that stands out to me is 5399dbf - @a-siva do you think this could be related?

  2. DanTup commented on Jul 8, 2025

    @DanTup
    CollaboratorAuthor

    Note: Running dartvm.exe foo.dart does work (I found dartvm in the CL linked above). So my guess is that it is related to how dart invokes dartvm?

  3. changed the title [-]Unable to run Dart scripts if the SDK is in a folder with special characters[/-] [+]Unable to run Dart scripts if the SDK is in a folder with special characters (spaces?) (on Windows?)[/+] on Jul 8, 2025
  4. a-siva commented on Jul 9, 2025

    @a-siva
    Contributor
  5. DanTup commented on Jul 9, 2025

    @DanTup
    CollaboratorAuthor

    @a-siva thanks for the quick fix! I can confirm that the latest bleeding-edge build that includes your change doesn't have this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions