xdelta3-python
xdelta3-python copied to clipboard
DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
Running
with open(ramdisk['path'], "rb") as original, \
open(f"{ramdisk['path']}.im4p", "rb") as new_file, \
open(f"{bundle}/{ramdisk['name'][:-4]}.asr.delta", "wb") as delta:
delta.write(xdelta3.encode(original.read(), new_file.read()))
results in
/Users/x/.pyenv/versions/3.9.0/lib/python3.9/site-packages/xdelta3/main.py:89: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
return _xdelta3.execute(new_value, original, flags, 0)
/Users/x/.pyenv/versions/3.9.0/lib/python3.9/site-packages/xdelta3/main.py:89: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
return _xdelta3.execute(new_value, original, flags, 0)
/Users/x/.pyenv/versions/3.9.0/lib/python3.9/site-packages/xdelta3/main.py:89: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
return _xdelta3.execute(new_value, original, flags, 0)
View this issue for details: https://github.com/python-pillow/Pillow/issues/3750
Please update code to remove warnings
The meaning of PY_SSIZE_T_CLEAN is described in https://python.readthedocs.io/en/stable/c-api/arg.html#strings-and-buffers.
To fix this issue define PY_SSIZE_T_CLEAN before including python.h:
#define NOT_MAIN 1
#define PY_SSIZE_T_CLEAN
#include "xdelta3.h"
#include "xdelta3.c"
#include <Python.h>
You will also need to change the type passed to '#' formats from int to Py_ssize_t,
I'm not using this library at the moment, feel free to submit a PR.
@samuelcolvin review the PR please and publish new version.
Thanks, I'll look at soon as I can.
Hello! dude! Looks like I need to switch to another diff library, you forgot about your project. It doesn't work starting from Python 3.10 because of current issue.
Hi "dude", no I didn't forget about my project. I have a baby, am CTO of a PLC and maintain numerous open soccer projects. I don't have time to review, merge and deploy every pull request quickly.
By all means use another library.
Understandable, have a nice day
@samuelcolvin transfer ownership of the repository and pip project to me please if you don't want to maintain it. 30 days passed... My jabber: vadimszzz[at]xmpp.is.