Skip to content
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

Merged
merged 1 commit into from Sep 6, 2017

Conversation

furiel
Copy link
Collaborator

@furiel furiel commented Aug 1, 2017

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.

Fixes: #1363

@kira-syslogng
Copy link
Contributor

Build FAILURE, the tests were executed on test branch: master and test suite: functions

@kira-syslogng
Copy link
Contributor

Build FAILURE, the tests were executed on test branch: master and test suite: functions

@kira-syslogng
Copy link
Contributor

Build SUCCESS, the tests were executed on test branch: master and test suite: functions

@kira-syslogng
Copy link
Contributor

Build FAILURE, $TEST_DESC_COMMENT

@furiel
Copy link
Collaborator Author

furiel commented Aug 2, 2017

@kira-syslogng retest this please

@kira-syslogng
Copy link
Contributor

Build SUCCESS, the tests were executed on test branch: master and test suite: functions

@kira-syslogng
Copy link
Contributor

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>
@kira-syslogng
Copy link
Contributor

Build SUCCESS, the tests were executed on test branch: master and test suite: functions

Copy link
Collaborator

@bazsi bazsi left a 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.

@kira-syslogng kira-syslogng merged commit caed9c9 into syslog-ng:master Sep 6, 2017
@lbudai lbudai removed the in progress label Sep 6, 2017
furiel added a commit to furiel/syslog-ng that referenced this pull request Sep 7, 2017
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>
@furiel furiel deleted the pythondest-v3 branch May 8, 2018 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants