Skip to content

fix(python): generated USDT constructor prevents importing bindings #194

Open

Description

@pwltr

Problem

Generated Python bindings cannot be imported because UsdtWallet.__init__ has required backup after optional bridge_url:

def __init__(..., bridge_url=..., backup):

Python raises SyntaxError: non-default argument follows default argument before any binding can be used.

Reproduction

Reproduced on unchanged master d10afd420474de8d0519965935c3f64695460aca and the rc12 candidate in #191, using Rust 1.90.0 and Python 3.9.6 on macOS:

CARGO_PROFILE_RELEASE_STRIP=false ./build_python.sh
PYTHONPATH=bindings/python python3 tests/bindings/trezor_records.py

Generation completes; the second command fails during import. The stripping override works around the separate macOS 27 host-dylib LINKEDIT issue and does not fix this Python syntax error.

Fresh generated Python files from the unchanged baseline and release candidate are byte-identical. The issue was also reproduced before the rc12 refresh on master 4affda1; it was not introduced by the release metadata changes.

The source constructor is in src/modules/usdt/wallet.rs, with #[uniffi::constructor(default(bridge_url = None))] and the required backup callback after that argument. Investigate the source annotation/signature and UniFFI Python generation; avoid hand-editing ignored generated bindings as the final fix.

Acceptance criteria

  • Regenerate valid Python bindings through the repository scripts.
  • PYTHONPATH=bindings/python python3 tests/bindings/trezor_records.py passes.
  • Add meaningful regression coverage for the USDT constructor signature/default handling.
  • Keep Swift/Kotlin consumer compatibility or explicitly document and coordinate any required API migration.

Release scope

The release author explicitly deferred this existing issue from the native 0.8.0-rc12 SDK release in #191. The iOS/Android SDK checks pass and that workflow does not distribute Python bindings. This deferral is not a claim that Python import passed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions