/usr/lib/python3/dist-packages/postgresql/types/io/stdlib_uuid.py is in python3-postgresql 1.1.0-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | import uuid
from ...types import UUIDOID
def uuid_pack(x, UUID = uuid.UUID, bytes = bytes):
if isinstance(x, UUID):
return bytes(x.bytes)
return bytes(UUID(x).bytes)
def uuid_unpack(x, UUID = uuid.UUID):
return UUID(bytes=x)
oid_to_io = {
UUIDOID : (uuid_pack, uuid_unpack),
}
|