/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: Parth Malwankar
  • Date: 2010-04-19 13:04:30 UTC
  • mfrom: (5165 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5166.
  • Revision ID: parth.malwankar@gmail.com-20100419130430-njvxdaka6xbqwvjw
merged in trunk and moved NEWS entry to right location.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006, 2008 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2008, 2009, 2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
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)