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
python-dest: string compatibility for python3 #1632
Conversation
Build FAILURE, the tests were executed on test branch: master and test suite: functions |
Build FAILURE, the tests were executed on test branch: master and test suite: functions |
Build SUCCESS, the tests were executed on test branch: master and test suite: functions |
Build FAILURE, $TEST_DESC_COMMENT |
@kira-syslogng retest this please |
Build SUCCESS, the tests were executed on test branch: master and test suite: functions |
Build SUCCESS, the tests were executed on test branch: master and test suite: functions |
Two changes in python3 c api compared to python2 1) In python3, all strings are utf8, so PyBytes_Check will fail. This patch will use PyUnicode_Check for python3 instead. 2) The function PyBytes_AsString is removed in python3. This patch will use PyUnicode_AsUTF8 instead. Signed-off-by: Antal Nemes <antal.nemes@balabit.com>
Build SUCCESS, the tests were executed on test branch: master and test suite: functions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this patchset, thanks.
Introduced in: syslog-ng#1632 A distribution might not label python pkg-config pc file as python2 or python3. In such case auto-detection will not work. In case of autodetection, we will look for pc files in this order: python3, python2, python. This will work on even archlinux where only python2 or python3 is used. The decision between v2 and v3 will be done later by a call to AC_CHECK_FUNCS instead. Signed-off-by: Antal Nemes <antal.nemes@balabit.com>
Two changes in python3 c api compared to python2:
patch will use PyUnicode_Check for python3 instead.
will use PyUnicode_AsUTF8 instead.
Fixes: #1363