Author guyrozendorn
Recipients Yoni.Tsafir, guyrozendorn, lars.gustaebel
Date 2012-09-24.01:53:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Here's a test case that re-creates this issue.
I chose to use mocks instead of sample files from sysfs so it would be simpler to run, it can be easily changed to use a file from sysfs.

The following code runs on Python2.7, requires the mock library

from unittest import TestCase
from tempfile import mkstemp
from mock import patch, Mock
from os import close, remove, write, stat
from posix import stat_result
from tarfile import TarFile

def fake_st_size_side_effect(*args, **kwargs):
    src, = args
    stats = stat(src)
    return stat_result((stats.st_mode, stats.st_ino, stats.st_dev, stats.st_nlink,
                       stats.st_uid, stats.st_gid, stats.st_size + 10,
                       stats.st_atime, stats.st_mtime, stats.st_ctime))

class Issue10760TestCase(TestCase):
    def setUp(self):
        fd, self.src = mkstemp()
        write(fd, '\x00' * 4)
        fd, self.dst = mkstemp()

    def test(self):
        with patch("os.lstat") as lstat:
            lstat.side_effect = fake_st_size_side_effect
            tar_file =, 'w:gz')

Date User Action Args
2012-09-24 01:53:54guyrozendornsetrecipients: + guyrozendorn, lars.gustaebel, Yoni.Tsafir
2012-09-24 01:53:53guyrozendornsetmessageid: <>
2012-09-24 01:53:53guyrozendornlinkissue10760 messages
2012-09-24 01:53:52guyrozendorncreate