Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One too many Leading / in URI #136

Open
CThuleHansen opened this issue Mar 4, 2021 · 2 comments
Open

One too many Leading / in URI #136

CThuleHansen opened this issue Mar 4, 2021 · 2 comments
Milestone

Comments

@CThuleHansen
Copy link

Error

The URI generated for a relative FMU directory path (a maybe for other cases) upon invoking initialize has a leading '/' too many. I believe the error is here:
The error might be located here:

fmuPath = "file:///" + fmu.path

Example:

{"fmus":{"{bodyFMU}":"Body"} ...

generates

{"fmus":{"{bodyFMU}":"file:////Users/au443759/Downloads/linefollower_ken/FMUs/Body"} ...

Running this from python urllib and getting the path gives the output: //Users/au443759/Downloads/linefollower_ken/FMUs/Body
which has an extra leading /.

Example of the described behavior (works for 6 months): https://www.online-python.com/9bPIl3NDp8

Corresponding python code:

from urllib.parse import urlparse
o = urlparse("file:////Users/au443759/Downloads/linefollower_ken/FMUs/Body")
print(o.path)
@idhugoid idhugoid added this to the 4.0.3 milestone Mar 12, 2021
@samajayi13
Copy link

"file://".replace(/\/g, "/").replace(/ /g, "%20"); produces "file://"
"file:///".replace(/\/g, "/").replace(/ /g, "%20"); produces "file:///"
I believe to solve this you simply have to remove the extra forward slash in fmuPath = "file:///" + fmu.path and make it fmuPath = "file://" + fmu.path

@idhugoid
Copy link
Contributor

idhugoid commented Apr 9, 2021

@samajayi13 can you have a look at this discussion INTO-CPS-Association/maestro#34 It may be the case that we need to check the URI standard and maybe use dome library code to generate the path... or just keep what we had.

@Unsongheroes Unsongheroes modified the milestones: 4.0.3, 4.0.4 May 7, 2021
@gi11 gi11 modified the milestones: 4.0.4, 4.0.5 Oct 12, 2021
@gi11 gi11 modified the milestones: 4.0.5, 4.0.6 Nov 23, 2021
@gi11 gi11 modified the milestones: 4.0.6, 4.0.7, 9.9.9 Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants