Closed rosanna-smith closed 5 months ago
I could not reproduce the error. I ran the above code, after adding the missing from rocrate.rocrate import ROCrate
, and it ran with no errors. No directory was created in exp_crate
and no @id
was changed to ./
.
This is with ro-crate-py from the current master
branch. I was able to reproduce the error with ro-crate-py 0.9.0, so this problem must have been fixed as a side effect of something that got merged after 0.9.0.
I guess the issue might be related to some kind of default of urllib.parse
library which depends on the Linux distribution or the Python installer, because I have been able to reproduce the issued found by @rosanna-smith with Python versions from 3.7 to 3.11 (btw, I'm using Gentoo Linux). I could not reproduce the issue with Python 3.12 because a different issue related to pkg_resources
arose.
I experienced something similar in an unrelated development when I was testing several interactions between JSON-LD processing libraries, relative URI resolution and the scheme used for the permanent identifiers.
All the tests were done in freshly created Python venvs, first updating pip and wheel, then installing rocrate package, and last testing the script (with the fix about adding from rocrate.rocrate import ROCrate
near its beginning).
We should be supporting ARCP URIs as in https://www.researchobject.org/ro-crate/1.1/appendix/relative-uris.html#establishing-a-base-uri-inside-a-zip-file and currently claim Python 3.7 is supported.
@elichad will investigate
This seems to be the same issue as #167, just with a slightly different manifestation. That issue was fixed in PR #168 but the fix hasn't been released yet - @stain @simleo is there anything blocking us from making a release?
I think we can make a release after merging #173.
@rosanna-smith can you check that the problem is solved in ro-crate 0.10.0?
Thanks! Can confirm this solved the problem on my end as well.
If you have a crate with an arcp identifier on the root dataset, the write method creates an unwanted arcp directory in the export and changes the ID to ./
Here's the code to reproduce this error:
It produces this error: