-
Notifications
You must be signed in to change notification settings - Fork 43
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
Provide a flag to open data packages with not safe paths? #171
Comments
@vitorbaptista
So for now a valid data package descriptor can't have path package = Package(descriptor, safe=False) And disable this |
@roll Taking a step back, what I want to do is create a datapackage with files from the local filesystem. Apparently, the way I can do this with the current code is by adding the resources in a folder, and passing that as a |
Currently, `datapackage-py` only supports "safe" resources, which when they're local resources it means that they must be located somewhere inside the datapackage.json's directory. I tried setting the DataPackage's base path as the directory where temporary files are created (e.g. `/tmp`), but that didn't work because the DP already has other local resources that don't live in `/tmp`. As the DataPackage that I'm loading is from a zip file, the directory its data live in exist only in memory, so I can't add new files to it. In the end, the cleanest solution was monkey patching (yeah, I know...). I simply mock the `datapackage.helpers.is_safe_path()` to always return true when saving the DataPackage, and everything works. This is a temporary solution. I created an issue on frictionlessdata/datapackage-py#171 to find a way that won't require monkey patching. openspending/openspending#1222
@roll So, it didn't work out. I have a datapackage that already has a local resource (it's inside a zip file), and I need to add more local resources. I tried changing the In the end, I had to mock out |
This is also an issue for me, as I described in the unnecessary duplicate issue: #261 |
Overview
We could allow to open data package with not safe paths if user explicitly choose it:
From @vitorbaptista
This is what I'm trying to do:
Reading the
helpers.is_safe_path()
method:datapackage-py/datapackage/helpers.py
Lines 189 to 196 in 3d25cfd
Makes me think that what I'm trying to do isn't possible anymore. Any known workarounds?
(cc @roll)
The text was updated successfully, but these errors were encountered: