EricssonResearch / calvin-base

Calvin is an application environment that lets things talk to things, among other things.
Apache License 2.0
282 stars 91 forks source link

Error running script on windows, path delimiter issue #92

Open remitassing opened 6 years ago

remitassing commented 6 years ago

Running the ui_in_gui.calvin example failed due to some path delimiter error

$ csruntime --host localhost ui_in_gui.calvin
Traceback (most recent call last):
  File "C:\Users\eremtas\Documents\Projects\Calvin\venv\Scripts\csruntime-script.py", line 11, in <module>
    load_entry_point('calvin', 'console_scripts', 'csruntime')()
  File "c:\users\eremtas\documents\projects\calvin\calvin-base\calvin\Tools\csruntime.py", line 368, in main
    set_config_from_args(args)
  File "c:\users\eremtas\documents\projects\calvin\calvin-base\calvin\Tools\csruntime.py", line 211, in set_config_from_args
    _conf = calvinconfig.get()
  File "c:\users\eremtas\documents\projects\calvin\calvin-base\calvin\utilities\calvinconfig.py", line 345, in get
    _config = CalvinConfig()
  File "c:\users\eremtas\documents\projects\calvin\calvin-base\calvin\utilities\calvinconfig.py", line 76, in __init__
    conf_paths = self.config_paths()
  File "c:\users\eremtas\documents\projects\calvin\calvin-base\calvin\utilities\calvinconfig.py", line 302, in config_paths
    curr_loc, part = curr_loc.rsplit('/', 1)
ValueError: need more than 1 value to unpack

I fixed it by changing curr_loc, part = curr_loc.rsplit('/', 1) into curr_loc, part = curr_loc.rsplit('\\', 1) but it'd be better to use the os.sep or os.path.dirname and os.path.basename

olaan commented 6 years ago

We do not have easy access to windows based computers. Could you submit your recommendation as a pull request on the develop branch?

Cheers,

// Ola