Lars Gustäbel <l...@gustaebel.de> added the comment:

Hm, why don't you just do this:

with stat_tarfile.open(fileobj = sys.stdout, mode = "w|") as tar:
    for number in xrange(100):
        fileobj = generate_file_content(number)
        tarinfo = tar.gettarinfo(fileobj=open("/etc/passwd")) 
        tarinfo.name = 'file-%d.txt' % number
        tarinfo.size = len(str(number)) * 100
        tarinfo.uid = 1000
        tarinfo.gid = 1000
        tarinfo.uname = "dstromberg"
        tarinfo.gname = "dstromberg"
        tar.addfile(tarinfo, fileobj)

Wouldn't that work, too? Or am I missing something?

----------
assignee:  -> lars.gustaebel
nosy: +lars.gustaebel

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10369>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to