Skip to content

Commit 6ea5452

Browse files
update datetime.utcnow() to use UTC timezone-aware object (#302)
1 parent 7380485 commit 6ea5452

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

livekit-api/livekit/api/access_token.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class VideoGrants:
4242
can_publish_data: bool = True
4343

4444
# TrackSource types that a participant may publish.
45-
# When set, it supercedes CanPublish. Only sources explicitly set here can be
45+
# When set, it supersedes CanPublish. Only sources explicitly set here can be
4646
# published
4747
can_publish_sources: List[str] = dataclasses.field(default_factory=list)
4848

@@ -154,9 +154,9 @@ def to_jwt(self) -> str:
154154
{
155155
"sub": self.identity,
156156
"iss": self.api_key,
157-
"nbf": calendar.timegm(datetime.datetime.utcnow().utctimetuple()),
157+
"nbf": calendar.timegm(datetime.datetime.now(datetime.timezone.utc).utctimetuple()),
158158
"exp": calendar.timegm(
159-
(datetime.datetime.utcnow() + self.ttl).utctimetuple()
159+
(datetime.datetime.now(datetime.timezone.utc) + self.ttl).utctimetuple()
160160
),
161161
}
162162
)

livekit-rtc/livekit/rtc/_proto/ffi_pb2.pyi

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

livekit-rtc/livekit/rtc/_proto/handle_pb2.pyi

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

livekit-rtc/livekit/rtc/participant.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def register_rpc_method(
301301
Establishes the participant as a receiver for calls of the specified RPC method.
302302
Can be used either as a decorator or a regular method.
303303
304-
The handler will recieve one argument of type `RpcInvocationData` and should return a string response which will be forwarded back to the caller.
304+
The handler will receive one argument of type `RpcInvocationData` and should return a string response which will be forwarded back to the caller.
305305
306306
The handler may be synchronous or asynchronous.
307307

livekit-rtc/livekit/rtc/video_frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def _get_plane_length(
218218
type: proto_video.VideoBufferType.ValueType, width: int, height: int
219219
) -> int:
220220
"""
221-
Return the size in bytes of a participar video buffer type based on its size (This ignore the strides)
221+
Return the size in bytes of a participant video buffer type based on its size (This ignores the strides)
222222
"""
223223
if type in [
224224
proto_video.VideoBufferType.ARGB,

0 commit comments

Comments
 (0)