Displaying 2 results from an estimated 2 matches for "8e7ed5c".
2014 Feb 03
1
[PATCH] hivex: python: value_value no longer generates Unicode strings
...yTuple_New (2);
PyTuple_SetItem (r, 0, PyLong_FromLong ((long) t));
- PyTuple_SetItem (r, 1, PyUnicode_DecodeUTF8 (val, len, NULL));
+ PyTuple_SetItem (r, 1, PyBytes_FromStringAndSize (val, len));
return r;
}
diff --git a/python/t/210-setvalue.py b/python/t/210-setvalue.py
index 2ee7ac5..8e7ed5c 100644
--- a/python/t/210-setvalue.py
+++ b/python/t/210-setvalue.py
@@ -19,6 +19,14 @@ import sys
import os
import hivex
+if sys.version >= '3':
+ import codecs
+ def b(x):
+ return codecs.encode(x)
+else:
+ def b(x):
+ return x
+
srcdir = os.environ["sr...
2014 Aug 16
7
[hivex] [PATCH 0/6] Python fixes for node_set_value
Hi,
This patch series is based on a prior patch[1], splitting off changes as
requested and incorporating feedback from Richard Jones. It introduces type
validation to avoid segmentation faults (instead, it reports an exception) and
fixes handling of the bytes type in Python 3.
Major changes since that series:
- Drop newly introduced support for integer types for DWORD/QWORDS
- Reject Unicode