~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: John Arbash Meinel
  • Date: 2006-06-11 02:22:55 UTC
  • mto: (1711.7.2 win32)
  • mto: This revision was merged to the branch mainline in revision 1796.
  • Revision ID: john@arbash-meinel.com-20060611022255-d65cae68762dca6a
In general, python on win32 needs to use the unicode os api, because bytestream stuff just doesn't work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
334
334
                # If LANG=C we probably have created some bogus paths
335
335
                # which rmtree(unicode) will fail to delete
336
336
                # so make sure we are using rmtree(str) to delete everything
337
 
                osutils.rmtree(test_root.encode(
338
 
                    sys.getfilesystemencoding()))
 
337
                # except on win32, where rmtree(str) will fail
 
338
                # since it doesn't have the property of byte-stream paths
 
339
                # (they are either ascii or mbcs)
 
340
                if sys.platform == 'win32':
 
341
                    # make sure we are using the unicode win32 api
 
342
                    test_root = unicode(test_root)
 
343
                else:
 
344
                    test_root = test_root.encode(
 
345
                        sys.getfilesystemencoding())
 
346
                osutils.rmtree(test_root)
339
347
        else:
340
348
            if self.pb is not None:
341
349
                self.pb.note("Failed tests working directories are in '%s'\n",