/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/export/tar_exporter.py

  • Committer: Jelmer Vernooij
  • Date: 2010-04-30 11:35:43 UTC
  • mfrom: (5195 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5197.
  • Revision ID: jelmer@samba.org-20100430113543-tiqqhmqa3d8no4iu
merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
    else:
49
49
        if root is None:
50
50
            root = export.get_root_name(dest)
51
 
        ball = tarfile.open(dest, 'w:' + compression)
 
51
 
 
52
        # tarfile.open goes on to do 'os.getcwd() + dest' for opening
 
53
        # the tar file. With dest being unicode, this throws UnicodeDecodeError
 
54
        # unless we encode dest before passing it on. This works around
 
55
        # upstream python bug http://bugs.python.org/issue8396
 
56
        # (fixed in Python 2.6.5 and 2.7b1)
 
57
        ball = tarfile.open(dest.encode(osutils._fs_enc), 'w:' + compression)
 
58
 
52
59
    for dp, ie in _export_iter_entries(tree, subdir):
53
60
        filename = osutils.pathjoin(root, dp).encode('utf8')
54
61
        item = tarfile.TarInfo(filename)