github pyozig/PyOZ v0.13.10
PyOZ v0.13.10

2 hours ago

What's New in v0.13.10

Fixed

  • Optimized Windows builds could hand out an import slot as a Python object. PyOZ took the address of Python's data (&c._Py_NoneStruct, the PyExc_* variables, type objects) as if it were known at link time. On Windows that data lives in the Python DLL and its address is only known at run time, from the import table; the optimizer placed such addresses in constant tables (the 61-entry exception table behind error mappings), and the linker filled them with the import slots' addresses. Raising a mapped exception from a release build could then crash. Every access now goes through pyoz.py.types.pyData, an @extern with is_dll_import on Windows, so the address is always loaded from the import slot, as __declspec(dllimport) does in C. This covers Py_None/Py_True/Py_False/Py_NotImplemented, all PyExc_* accessors and the type objects.
  • pyoz.bases.Exception, ValueError, TypeError and RuntimeError did not compile and would have returned type instead of the exception class.

Added

  • pyoz build checks Windows modules for constants holding an import slot's address and refuses to package one, naming the first symbol. This also catches user code that takes the address of Python data directly (&pyoz.py.c._Py_NoneStruct). CI cross-builds the example module for Windows with this check, and runs it optimized on Windows.

Installation

Download the binary for your platform and add it to your PATH:

Platform Binary
Linux x86_64 pyoz-x86_64-linux
Linux ARM64 pyoz-aarch64-linux
macOS x86_64 pyoz-x86_64-macos
macOS ARM64 (Apple Silicon) pyoz-aarch64-macos
Windows x86_64 pyoz-x86_64-windows.exe
Windows ARM64 pyoz-aarch64-windows.exe

Source

Download PyOZ-0.13.10.tar.gz for the source code.

Quick Start

pyoz init mymodule
cd mymodule
pyoz build
pip install dist/*.whl

Don't miss a new PyOZ release

NewReleases is sending notifications on new releases.