[PATCH] bzr selftest fails on Mac because of bogus /tmp location
Aaron Bentley
aaron.bentley at utoronto.ca
Mon Jul 11 20:28:09 BST 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I think it's better to fix the code than to fix the test case. I think
you just need to change the call from
rp = os.path.abspath(path)
to
rp = os.path.realpath(path)
That way, _relpath() is more reliable.
Aaron
John A Meinel wrote:
> On Mac OSX /tmp is actually a symlink to /private/tmp
> so _relpath() fails because the real full path is different.
>
> The attached path just makes dtmp be expanded to it's real path, which
> makes the tests pass.
>
> John
> =:->
>
>
> ------------------------------------------------------------------------
>
> *** modified file 'bzrlib/selftest/whitebox.py'
> --- bzrlib/selftest/whitebox.py
> +++ bzrlib/selftest/whitebox.py
> @@ -193,6 +193,8 @@
>
> savedir = os.getcwdu()
> dtmp = tempfile.mkdtemp()
> + # On Mac OSX, /tmp actually expands to /private/tmp
> + dtmp = os.path.realpath(dtmp)
>
> def rp(p):
> return _relpath(dtmp, p)
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFC0shJ0F+nu1YWqI0RAmloAJ4mMJCSG45io5DmV17dmC1VL6KlswCfYYv/
blglHTuegjgNgFYsqDVg620=
=sUJv
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list