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

cx_oracle emits deprecation warning and/or segfaults under python 3.8.0b1 #317

Closed
zzzeek opened this issue Jun 8, 2019 · 3 comments
Closed
Labels
bug patch available Awaiting inclusion in official release

Comments

@zzzeek
Copy link

zzzeek commented Jun 8, 2019

cx_Oracle generates this warning under Python 3.8.0b1 when an output type handler is used:

DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats

If you turn on the "error" handler for the warnings filter, then it segfaults.

Complete example:

import cx_Oracle
import warnings

# comment to only emit a warning, not segfault
warnings.filterwarnings("error", category=DeprecationWarning)


conn = cx_Oracle.connect(
    user="scott",
    password="tiger",
    dsn=cx_Oracle.makedsn("oracle1120", 1521, sid="xe"),
)

def output_type_handler(
    cursor, name, default_type, size, precision, scale
):
    return None

# comment out to remove the warning
conn.outputtypehandler = output_type_handler

cursor = conn.cursor()

cursor.execute(
    "select 1 from dual",
)

@methane
Copy link

methane commented Jun 8, 2019

ref: https://bugs.python.org/issue36381

When parsing or building value by format with "#" (e.g. "s#"), Python will not support int for size from Python 3.10. We need to use Py_ssize_t instead and #define PY_SSIZE_T_CLEAN before #include <Python.h>.

@cjbj cjbj added the bug label Jun 9, 2019
@anthony-tuininga
Copy link
Member

Just to reassure you: I haven't lost track of this and have already made some of the necessary changes. I hope to have this addressed next week.

anthony-tuininga added a commit that referenced this issue Jun 17, 2019
@anthony-tuininga anthony-tuininga added the patch available Awaiting inclusion in official release label Jun 17, 2019
@anthony-tuininga
Copy link
Member

This has been released with cx_Oracle 7.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug patch available Awaiting inclusion in official release
Projects
None yet
Development

No branches or pull requests

4 participants