Restoring session with plus in command line

edited February 2021 in KLayout Support

Hi, Matthias!

I encountered problem with restoring session from command line (layout files are not loaded) when directory name contains + (i. e. klayout -u <absolute path with + sign> -d 10). Session contains relative paths to layout. I traced root of problem to Session::make_absolute call from Session::restore. URI::to_string always escapes plus as well as other special characters even if URI is plain file path, so resulting absolute path is incorrect. My naive workaround is:

  if (! m_path.empty ()) {
-    res += escape (m_path);
+    if (res.empty())
+      res = m_path;
+    else
+      res += escape (m_path);
  }

Probably there is better way to deal with URI than that.

Problem exists in 0.26.4 and 0.26.10.

Comments

  • Same problem happens when session is restored in GUI or relative path is used, i. e. KLayout started from path with + sign and relative path in command line doesn't contain it.

  • I'm not aware about design intent, but it'll be good idea to treat path in command-line parameters and internally constructed ones in same way. Currently former is taken in raw form without converting to URI when later are converted to URI.

  • Yes, I can reproduce the problem. Thanks for reporting that issue.

    I have created a ticket for this: https://github.com/KLayout/klayout/issues/733

    Matthias

Sign In or Register to comment.