You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cgi.FieldStorage is list truthy (if it's list member is true), but setting the file doesn't add any fields into the list, so it's falsy. werkzurg.datastructures.FileStorage has different falsy behavior.
stdlib cgi is deprecated in 3.13, because there's basically no maintainers and there are weird bugs in it. We are going to eventually need to shift off of it.
werkzurg works as a drop in replacement here, and should be supported going forward. It will certainly work for local ckan at any rate, because we're going to have it installed already for ckan.
Perhaps the truthy test would be better as a is not None in ResourceUpload
The text was updated successfully, but these errors were encountered:
Stumbled to this as well, our local file uploads have been failing for awhile and I started looking into it. cgi.FieldStorage should be removed as its there only for backwards compatibility and since ckan 2.8 hasn't been supported for awhile, ckanapi could do without it as well.
I spent last night tracking down a resource upload issue in 2.9 / python 3.8-- and it looks like a combination of Ckan and CkanAPI.
Uploads were silently failing to save with this code:
LocalCkan creates a
cgi.FieldStorage
, and passes it into the action chain, which ultimately creates a ResourceUpload here: https://github.com/ckan/ckan/blob/2.9/ckan/lib/uploader.py#L262.This is checking for truthy file uploads, and one of the allowed types.
cgi.FieldStorage
is list truthy (if it's list member is true), but setting the file doesn't add any fields into the list, so it's falsy.werkzurg.datastructures.FileStorage
has different falsy behavior.I fixed my issue by
So, there are a couple of things.
is not None
in ResourceUploadThe text was updated successfully, but these errors were encountered: