Skip to content

Commit 64629dc

Browse files
[bug] Missing tzinfo (#139)
Why === If tzinfo is None, msgpack will explode. What changed ============ Add missing tzinfo Test plan ========= Manual testing verified this is correct
1 parent 78c6d29 commit 64629dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/replit_river/codegen/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def _{m.name}Encoder(
269269
chunks.append(f" match e.WhichOneof({repr(oneof.name)}):")
270270
for field in oneofs[index]:
271271
if field.type_name == ".google.protobuf.Timestamp":
272-
value = f"e.{field.name}.ToDatetime()"
272+
value = f"e.{field.name}.ToDatetime(tzinfo=datetime.timezone.utc)"
273273
elif field.type == descriptor_pb2.FieldDescriptorProto.TYPE_MESSAGE:
274274
encode_method_name = get_encoder_name(field)
275275
value = f"{encode_method_name}(e.{field.name})"

0 commit comments

Comments
 (0)