changeset 52589:30f81efce00b

largefiles: use `stat_result.st_size` instead of a magic tuple index
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 16 Dec 2024 20:40:04 -0500
parents 5dcf40af7c2d
children 7da165194128
files hgext/largefiles/proto.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/largefiles/proto.py	Mon Dec 16 20:38:13 2024 -0500
+++ b/hgext/largefiles/proto.py	Mon Dec 16 20:40:04 2024 -0500
@@ -74,7 +74,7 @@
 
     # TODO: fix the fd leak here
     f = open(filename, 'rb')
-    length = os.fstat(f.fileno())[6]
+    length = os.fstat(f.fileno()).st_size
 
     # Since we can't set an HTTP content-length header here, and
     # Mercurial core provides no way to give the length of a streamres