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

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).

Environment

Windows OS

Activity

Show:
Mike Fikes
June 20, 2019, 12:43 PM

CLJS-2155-2.patch added to Patch Tender

Mike Fikes
June 15, 2019, 2:25 PM

CLJS-2155-2.patch passes CI

Vojimir Golem
June 15, 2019, 11:21 AM

Hi Mike, I have attached a new patch with your suggested approach.

Mike Fikes
June 14, 2019, 8:14 PM

Hey David, even though you marked this one as accepted, my take on the above was that I had suggested perhaps a cleaner way to Vojimir, he had tried it, and it worked for him. I think we'd be interested in Vojimir's cleaner patch.

Vojimir Golem
May 22, 2019, 9:06 PM

I have tried WO "file://", as you have said, and it works perfectly.
Thx!

Assignee

David Nolen

Reporter

Vojimir Golem

Approval

Accepted

Patch

Code