diff -Nru yara-python-3.8.0/debian/changelog yara-python-3.9.0/debian/changelog --- yara-python-3.8.0/debian/changelog 2018-11-03 12:10:53.000000000 +0000 +++ yara-python-3.9.0/debian/changelog 2019-02-22 22:45:21.000000000 +0000 @@ -1,8 +1,11 @@ -yara-python (3.8.0-1build1) disco; urgency=medium +yara-python (3.9.0-1) unstable; urgency=medium - * No-change rebuild to build without python3.6 support. + * New upstream version 3.9.0 + * Bump Debhelper compat level + * Bump Standards-Version + * Bump libyara build dependency - -- Matthias Klose Sat, 03 Nov 2018 12:10:53 +0000 + -- Hilko Bengen Fri, 22 Feb 2019 23:45:21 +0100 yara-python (3.8.0-1) unstable; urgency=medium diff -Nru yara-python-3.8.0/debian/compat yara-python-3.9.0/debian/compat --- yara-python-3.8.0/debian/compat 2017-11-11 11:42:20.000000000 +0000 +++ yara-python-3.9.0/debian/compat 2019-02-22 22:41:53.000000000 +0000 @@ -1 +1 @@ -10 +12 diff -Nru yara-python-3.8.0/debian/control yara-python-3.9.0/debian/control --- yara-python-3.8.0/debian/control 2018-08-10 12:45:25.000000000 +0000 +++ yara-python-3.9.0/debian/control 2019-02-22 22:44:53.000000000 +0000 @@ -3,11 +3,11 @@ Priority: optional Maintainer: Hilko Bengen Uploaders: Debian Security Tools -Build-Depends: debhelper (>=10), dh-python, +Build-Depends: debhelper (>= 12~), dh-python, python-all-dev (>= 2.6.6-3~), python-setuptools, python3-all-dev, python3-setuptools, - libyara-dev (>= 3.8), -Standards-Version: 4.2.0 + libyara-dev (>= 3.9), +Standards-Version: 4.3.0 Homepage: https://pypi.python.org/pypi/yara-python Vcs-Git: https://salsa.debian.org/pkg-security-team/yara-python.git Vcs-Browser: https://salsa.debian.org/pkg-security-team/yara-python diff -Nru yara-python-3.8.0/.gitmodules yara-python-3.9.0/.gitmodules --- yara-python-3.8.0/.gitmodules 2018-08-06 14:26:33.000000000 +0000 +++ yara-python-3.9.0/.gitmodules 2019-02-22 17:05:58.000000000 +0000 @@ -1,3 +1,3 @@ [submodule "yara"] path = yara -url=https://plusvic@github.com/VirusTotal/yara.git +url=https://github.com/VirusTotal/yara.git diff -Nru yara-python-3.8.0/setup.py yara-python-3.9.0/setup.py --- yara-python-3.8.0/setup.py 2018-08-06 14:26:33.000000000 +0000 +++ yara-python-3.9.0/setup.py 2019-02-22 17:05:58.000000000 +0000 @@ -311,7 +311,7 @@ setup( name='yara-python', - version='3.8.0', + version='3.9.0', description='Python interface for YARA', long_description=readme, license='Apache 2.0', diff -Nru yara-python-3.8.0/tests.py yara-python-3.9.0/tests.py --- yara-python-3.8.0/tests.py 2018-08-06 14:26:33.000000000 +0000 +++ yara-python-3.9.0/tests.py 2019-02-22 17:05:58.000000000 +0000 @@ -813,6 +813,15 @@ r = yara.compile(source='rule test { condition: ext_str matches /ssi$/ }', externals={'ext_str': 'mississippi'}) self.assertFalse(r.match(data='dummy')) + if sys.version_info[0] >= 3: + self.assertTrue(yara.compile( + source="rule test { condition: true}", + externals={'foo': u'\u6765\u6613\u7f51\u7edc\u79d1' })) + else: + self.assertRaises(UnicodeEncodeError, yara.compile, + source="rule test { condition: true}", + externals={'foo': u'\u6765\u6613\u7f51\u7edc\u79d1' }) + def testCallbackAll(self): global rule_data rule_data = [] diff -Nru yara-python-3.8.0/yara-python.c yara-python-3.9.0/yara-python.c --- yara-python-3.8.0/yara-python.c 2018-08-06 14:26:33.000000000 +0000 +++ yara-python-3.9.0/yara-python.c 2019-02-22 17:05:58.000000000 +0000 @@ -47,8 +47,7 @@ #if PY_MAJOR_VERSION >= 3 #define PY_STRING(x) PyUnicode_FromString(x) -#define PY_STRING_TO_C(x) PyBytes_AsString(\ - PyUnicode_AsEncodedString(x, "utf-8", "strict")) +#define PY_STRING_TO_C(x) PyUnicode_AsUTF8(x) #define PY_STRING_CHECK(x) PyUnicode_Check(x) #else #define PY_STRING(x) PyString_FromString(x) @@ -425,7 +424,7 @@ { case OBJECT_TYPE_INTEGER: if (object->value.i != UNDEFINED) - result = Py_BuildValue("i", object->value.i); + result = Py_BuildValue("l", object->value.i); break; case OBJECT_TYPE_STRING: @@ -1003,10 +1002,13 @@ } else if (PY_STRING_CHECK(value)) { + char* str = PY_STRING_TO_C(value); + + if (str == NULL) + return ERROR_INVALID_ARGUMENT; + result = yr_compiler_define_string_variable( - compiler, - identifier, - PY_STRING_TO_C(value)); + compiler, identifier, str); } else { @@ -1070,10 +1072,13 @@ } else if (PY_STRING_CHECK(value)) { + char* str = PY_STRING_TO_C(value); + + if (str == NULL) + return ERROR_INVALID_ARGUMENT; + result = yr_rules_define_string_variable( - rules, - identifier, - PY_STRING_TO_C(value)); + rules, identifier, str); } else { @@ -2367,6 +2372,10 @@ if (PyType_Ready(&Match_Type) < 0) return MOD_ERROR_VAL; + PyModule_AddObject(m, "Rule", (PyObject*) &Rule_Type); + PyModule_AddObject(m, "Rules", (PyObject*) &Rules_Type); + PyModule_AddObject(m, "Match", (PyObject*) &Match_Type); + PyModule_AddObject(m, "Error", YaraError); PyModule_AddObject(m, "SyntaxError", YaraSyntaxError); PyModule_AddObject(m, "TimeoutError", YaraTimeoutError);