Don't use shutil.move instead of osutils.rename

David Allouche david at allouche.net
Mon Dec 5 20:51:35 GMT 2005


On Fri, 2005-12-02 at 16:19 -0600, John A Meinel wrote:
> All it is testing is that it can spawn a sub-process. I'm thinking we
> can do it in a different way.
> 
> I just switched it to use:
> 
> 	python -c "import sys; sys.stdout.write(sys.stdin.read())"
> 
> Which should be exactly what we need from 'cat'
> Since bzrlib is python program, we certainly should have a python
> interpreter available.

Actually you need to do it a bit differently, because you have no
guarantee that the python interpreter is in the PATH.

Something like:

	process = Popen([sys.executable, '-c', script], **kwargs)

Which is what I used in the Gnarly test suite.

> It turns out we need an ugly fix, though.
> In python sys.stdout is defaulted to open in text mode on windows. So we
> need to do this:
> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65443

Interesting.
-- 
                                                            -- ddaa
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051205/0655163d/attachment.pgp 


More information about the bazaar mailing list