/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/tests/test_btree_index.py

  • Committer: John Arbash Meinel
  • Date: 2010-03-25 17:09:53 UTC
  • mto: This revision was merged to the branch mainline in revision 5116.
  • Revision ID: john@arbash-meinel.com-20100325170953-s6qzmwap7mg0frcx
Workaround a strange bug about the file closing before it is read.

Show diffs side-by-side

added added

removed removed

Lines of Context:
617
617
                                           reference_lists=ref_lists)
618
618
        builder.add_nodes(nodes)
619
619
        transport = self.get_transport('')
620
 
        content = builder.finish().read()
 
620
        # NamedTemporaryFile dies on builder.finish().read(). weird.
 
621
        temp_file = builder.finish()
 
622
        content = temp_file.read()
 
623
        del temp_file
621
624
        size = len(content)
622
625
        transport.put_bytes('index', (' '*offset)+content)
623
626
        return btree_index.BTreeGraphIndex(transport, 'index', size=size,