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

pyopf.io.load doesn't handle absolute windows paths #6

Closed
Wumpf opened this issue Oct 9, 2023 · 1 comment
Closed

pyopf.io.load doesn't handle absolute windows paths #6

Wumpf opened this issue Oct 9, 2023 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@Wumpf
Copy link

Wumpf commented Oct 9, 2023

Passing in an absolute path on windows results in this exception:

Traceback (most recent call last):
  File "C:\dev\rerun\rerun\examples\python\open_photogrammetry_format\main.py", line 220, in <module>
    main()
  File "C:\dev\rerun\rerun\examples\python\open_photogrammetry_format\main.py", line 209, in main
    project = OPFProject.from_dataset(args.dataset, log_as_frames=not args.no_frames)
  File "C:\dev\rerun\rerun\examples\python\open_photogrammetry_format\main.py", line 107, in from_dataset
    return cls(DATASET_DIR / spec.dir_name / "project.opf", log_as_frames=log_as_frames)
  File "C:\dev\rerun\rerun\examples\python\open_photogrammetry_format\main.py", line 85, in __init__
    self.project = resolve(load(str(path)))
  File "C:\Python310\lib\site-packages\pyopf\io\loaders.py", line 143, in load
    accepted, params = test(resource, base_uri, additional_resources)
  File "C:\Python310\lib\site-packages\pyopf\io\loaders.py", line 73, in _test_json_resource
    uri = join_uris(resource, base_uri)
  File "C:\Python310\lib\site-packages\pyopf\io\loaders.py", line 31, in join_uris
    raise RuntimeError("Non-file URIs are not supported")
RuntimeError: Non-file URIs are not supported

After a bit try and error I figured out that this can be worked around with DOS UNC paths

"\\\\.\\" + str(path.absolute()) if os.name == "nt" else str(path)

See also rerun-io/rerun#3705

@krahenbuhl krahenbuhl added good first issue Good for newcomers bug Something isn't working labels Nov 23, 2023
@krahenbuhl
Copy link
Contributor

Hi @Wumpf, this should be fixed in the new version we just released (1.2.0). Please feel free to reopen if you still have issues! Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants