Skip to content

Display oids in same format as ZODB.utils.oid_repr#220

Merged
perrinjerome merged 1 commit intomasterfrom
perrinjerome/fix_oid_repr
Jun 9, 2025
Merged

Display oids in same format as ZODB.utils.oid_repr#220
perrinjerome merged 1 commit intomasterfrom
perrinjerome/fix_oid_repr

Conversation

@perrinjerome
Copy link
Copy Markdown
Contributor

Fixes #219

@icemac icemac requested review from Copilot, d-maurer and dataflake June 4, 2025 14:21
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the representation of persistent object OIDs to follow the same format as ZODB’s oid_repr. The changes include adding a new test for short, odd-length OIDs in Python, introducing an oid_repr helper in Python to format OIDs, updating the C implementation to apply similar zero-padding logic, and documenting the change in CHANGES.rst.

  • Added test case test_short_odd_oid in tests.
  • Created Python helper function oid_repr for OID formatting.
  • Updated C code in cPersistence.c to mirror the Python zero-padding behavior.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/persistent/tests/test_persistence.py Added test to validate short OID representation
src/persistent/persistence.py Introduced oid_repr function for OID formatting
src/persistent/cPersistence.c Updated C implementation to apply zero-padding
CHANGES.rst Documented the oid_repr formatting update

@perrinjerome
Copy link
Copy Markdown
Contributor Author

Thanks @dataflake

@perrinjerome perrinjerome merged commit a5bafe1 into master Jun 9, 2025
49 checks passed
@perrinjerome perrinjerome deleted the perrinjerome/fix_oid_repr branch June 9, 2025 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

persistent.Persistent.__repr__ displays oids incompatible with repr_to_oid

3 participants