UniFormal / MMT

The MMT Language and System
https://uniformal.github.io/
Other
68 stars 23 forks source link

MMT crashes when path contains space #574

Closed ghost closed 2 years ago

ghost commented 2 years ago

MMT currently crashes with the following error on linux when the path where the jar is located contains a space. #222 might be related.

Exception in thread "main" general error: cannot find resource /mmtrc (run style is Classes(/home/local/source/MMT%20test/deploy/mmt.jar))
    at info.kwarc.mmt.api.utils.MMTSystem$.getResourceAsString(System.scala:133)
    at info.kwarc.mmt.api.frontend.Controller.init(Controller.scala:218)
    at info.kwarc.mmt.api.frontend.Controller.<init>(Controller.scala:222)
    at info.kwarc.mmt.api.frontend.Shell.controller$lzycompute(Shell.scala:50)
    at info.kwarc.mmt.api.frontend.Shell.controller(Shell.scala:50)
    at info.kwarc.mmt.api.frontend.Shell.main(Shell.scala:61)
    at info.kwarc.mmt.api.frontend.Run.main(Shell.scala)

is there a reason why MMT is handling treating an URL as a file path here ? otherwise a possible fix would be to decode the url back to an unencoded path string:

val classFolder = File(URLDecoder.decode(location.getPath, StandardCharsets.UTF_8))
ghost commented 2 years ago

this also seems to happen for paths with other url encoded symbols eg. german umlauts