# HG changeset patch # User Matt Harbison # Date 1734399604 18000 # Node ID 30f81efce00b0b07842464165d6383eb95e102b9 # Parent 5dcf40af7c2d0884ab0681430db4674404582ca3 largefiles: use `stat_result.st_size` instead of a magic tuple index diff -r 5dcf40af7c2d -r 30f81efce00b hgext/largefiles/proto.py --- 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