Skip to content

Commit

Permalink
fix: ensure bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco committed May 1, 2023
1 parent fb2ca02 commit 87d5252
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ulid_transform/_ulid_impl.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def _ulid_at_time(_time: float) -> str:
def _ulid_to_bytes(ulid_str: str) -> bytes:
if len(ulid_str) != 26:
raise ValueError(f"ULID must be a 26 character string: {ulid_str}")
return _cpp_ulid_to_bytes(ulid_str)
return _cpp_ulid_to_bytes(ulid_str).encode("ascii")

def _bytes_to_ulid(ulid_bytes: bytes) -> str:
if len(ulid_bytes) != 16:
Expand Down

0 comments on commit 87d5252

Please sign in to comment.