ClojureScript

building fileUrl on windows in repl.cljc results with java.net.UnknownHostException

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.9.671
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    Windows OS

Description

I think that the following line might cause the problem on windows:
https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/repl.cljc#L713

For file param e.g. "src\duct3\client.cljs"

(str "file://" (.getAbsolutePath file))

evaluates on windows as:
"file://C:\Projects\Playground\duct3\src\duct3\client.cljs"

which is not legal file Url (https://en.wikipedia.org/wiki/File_URI_scheme#Windows)

and final result is: java.net.UnknownHostException (java treat that URL as FTP address).

Activity

Hide
Vojimir Golem added a comment -

Added different prefix for windows platform.

Show
Vojimir Golem added a comment - Added different prefix for windows platform.

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated: