ledger icon indicating copy to clipboard operation
ledger copied to clipboard

Ledger 3.3.2 cannot be built with Python 3.12 support

Open Rudd-O opened this issue 1 year ago • 5 comments

Python deprecated a long time ago the PyUnicode_AS_UNICODE macro and PyUNICODE type, per https://peps.python.org/pep-0624/ . With Python 3.12, these have been finally removed.

As a result, building on Fedora 39 with Python support is not possible anymore, because Fedora comes with Python 3.12.

I'm not sure what needs to be fixed, but it looks like a simple fix of changing a few macros. Thanks in advance for looking into it.

Rudd-O avatar Feb 23 '24 03:02 Rudd-O

Thanks for raising this, @Rudd-O. I know I addressed deprecated Python APIs some time ago, but seems I missed a few spots. I'll look into it.

afh avatar Feb 23 '24 14:02 afh

Thank you so much for your prompt attention to the issue! I believe when this is fixed, Ledger's Python support will soon be enabled back in Fedora.

Rudd-O avatar Feb 24 '24 02:02 Rudd-O

@Rudd-O, while I dig deeper into the issue, could you provide more details, e.g. failing ledger build log or examples of code you consider problematic? I'm able to compile ledger with Python 3.12.1, yet when doing an import ledger I get the following error message: ImportError: dlopen(/Users/afh/Developer/ledger/ledger.so, 0x0002): symbol not found in flat namespace '__PyUnicode_Ready'

afh avatar Feb 24 '24 18:02 afh

@Rudd-O I've put up #2333 for review, could you check whether the changes in said PR, address the build errors for you?

afh avatar Feb 25 '24 16:02 afh

Friendly ping on this, @Rudd-O 🙂

afh avatar Mar 05 '24 21:03 afh