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

SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats #557

Open
sweettyler opened this issue May 16, 2023 · 2 comments
Open

Comments

@sweettyler
Copy link

The error message comes from

File "/home/xxxx/mambaforge/lib/python3.10/site-packages/segyio/trace.py", line 290, in setitem
self.filehandle.puttr(self.wrapindex(i), xs)
SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats

The following is further explained in https://docs.python.org/3/c-api/arg.html#strings-and-buffers
"
Note For all # variants of formats (s#, y#, etc.), the macro PY_SSIZE_T_CLEAN must be defined before including Python.h. On Python 3.9 and older, the type of the length argument is Py_ssize_t if the PY_SSIZE_T_CLEAN macro is defined, or int otherwise.
"

@learnml2020
Copy link

I ran into the same problem when I tried to copy a.sgy to b.sgy use the line "dst.trace=src.trace"
the python version is 3.12.0
the segyio version 1.9.3

@ajmalkoti
Copy link

ajmalkoti commented Jan 5, 2024

I ran into a similar problem with segyio ver. 1.9.3.
Reinstalling the segyio with the latest version (1.9.12) resolved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants