Skip to content

Spaces in paths not supported in javalib on Windows #2433

Closed
@jchyb

Description

@jchyb

Example:

import java.nio.file.Paths
object Main {
  def main(args: Array[String]): Unit = {
    val path = Paths.get("test file")
  }
}

Native bahavior:

java.nio.file.InvalidPathException: java.nio.file.InvalidPathException: Illegal character ` ` in path at index 4: test file
        at java.lang.StackTrace$.currentStackTrace(Unknown Source)
        at java.lang.Throwable.fillInStackTrace(Unknown Source)   
        at scala.collection.immutable.WrappedString$$$Lambda$1.apply(Unknown Source)
        at scala.scalanative.nio.fs.windows.WindowsPathParser$.apply(Unknown Source)
        at Main$.main(Unknown Source)
        at <none>.main(Unknown Source)
        at <none>.__scrt_common_main_seh:(d:\a01\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)(Unknown Source)
        at <none>.BaseThreadInitThunk(Unknown Source)
        at <none>.RtlUserThreadStart(Unknown Source)

Expected (jvm) behavior:
Runs fine, we can of course also do any actual operations on that file.

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