patch 8.1.0735: cannot handle binary data
Problem: Cannot handle binary data.
Solution: Add the Blob type. (Yasuhiro Matsumoto, closes #3638)
diff --git a/src/if_py_both.h b/src/if_py_both.h
index 1c15926..0b8a360 100644
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -867,6 +867,10 @@
}
return ret;
}
+ else if (our_tv->v_type == VAR_BLOB)
+ ret = PyBytes_FromStringAndSize(
+ (char*) our_tv->vval.v_blob->bv_ga.ga_data,
+ (Py_ssize_t) our_tv->vval.v_blob->bv_ga.ga_len);
else
{
Py_INCREF(Py_None);
@@ -6394,6 +6398,10 @@
tv->vval.v_partial->pt_argc, argv,
tv->vval.v_partial->pt_dict,
tv->vval.v_partial->pt_auto);
+ case VAR_BLOB:
+ return PyBytes_FromStringAndSize(
+ (char*) tv->vval.v_blob->bv_ga.ga_data,
+ (Py_ssize_t) tv->vval.v_blob->bv_ga.ga_len);
case VAR_UNKNOWN:
case VAR_CHANNEL:
case VAR_JOB: