Fix "PY_SSIZE_T_CLEAN macro must be defined for '#' formats" error#83
Conversation
- error due to change in Python 3.10 C API
|
These docs don't say anything about setting it to https://docs.python.org/3/c-api/intro.html#include-files Any idea if it makes a difference when things are actually compiled? Also, I'm not sure why appveyor is being brought into CI, I thought I deleted that. Is there a chance you are using an old version of |
I think it just has do be defined so that it tests to True
Well, yes. I mean
|
Probably. My clone still has |
|
Looking at the history of the file you modified it looks like you forks master may not be up to date. Not a huge deal this time.
Sorry, I meant does the |
I think it needs to be defined, according to the document, but I suspect the reason they did it this way is for backward compatibility with older python versions. I just followed the example of another project that had made the same fix. If you google "PY_SSIZE_T_CLEAN macro must be defined for '#' formats" you will find a bunch of projects that had to make this fix for 3.10. I just followed one example, which defined the value as 1. |
|
Ok. Yeah I was just wondering about the |
|
The module imports ok without the fix, but if you try to do a |
|
Ok. Thanks. I will merge this when I have time to make a release. I'll have to cherry-pick the commit to the |
🙏 |
|
It looks like https://github.com/pytroll/aggdraw/runs/7064936012?check_suite_focus=true This very likely isn't caused by your changes, but do you have any ideas what I should do? I could add So it is definitely pulling in a freetype we don't want. I guess I could try to force it to not find it. |
|
Ok I've disabled freetype in the Windows wheels. If someone wants freetype support from the Windows wheels then they'll need to build aggdraw from source or submit an issue to this github repository to request the functionality (and hopefully volunteer to do the work to fix it in github actions CI). |
|
FYI this should be available in 1.3.15 on PyPI and conda-forge now. |
|
|
|
Agreed. I'm also not aware of how people usually get freetype on Windows so besides the conda package, any wheels we make would probably be incompatible. |
|
Thanks! |
There was a change in the C API for Python 3.10. aggdraw will compile, but not run correctly under python 3.10.
You will get the error: "PY_SSIZE_T_CLEAN macro must be defined for '#' formats"
This fixes that issue.