You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Neels Hofmeyr <ne...@elego.de> on 2013/06/03 12:47:05 UTC

[PATCH] Make svnperms.py work on Windows

Hi dev,

I tried to get svnperms.py going on a windows server (<rolls eyes>),
but needed this patch to do so:

http://svn.haxx.se/dev/archive-2009-04/0668.shtml

It seems that no-one has answered Sergey on his patch submission back
in 2009. (According to haxx.se, that thread ends right there.)

The patch removes a try-import-except-import thing and replaces it with
a straightforward 'from subprocess import Popen,PIPE'. AFAICT that works
almost everywhere and is a good change.

So, if there are no vetos, I'll commit this patch.

Thanks,
~Neels

Re: [PATCH] Make svnperms.py work on Windows

Posted by Neels Hofmeyr <ne...@elego.de>.
Branko Čibej <br...@apache.org>:
> I believe the patch is not correct. It assumes unlimited buffering on
> the stdout and stderr pipes, which is never the case. The way Popen is
> used on the patch can cause the parent and child processes to
> deadlock.
> 
> I suggest using Popen.communicate instead.

Agreed. communicate() is what I'd have used, too.

Any other problems with the patch?

It possibly is incompatible with some older version of
python ... but I'd argue that subprocess.Popen is old enough.

~Neels

Re: [PATCH] Make svnperms.py work on Windows

Posted by Branko Čibej <br...@apache.org>.
On 03.06.2013 12:47, Neels Hofmeyr wrote:
> Hi dev,
>
> I tried to get svnperms.py going on a windows server (<rolls eyes>),
> but needed this patch to do so:
>
> http://svn.haxx.se/dev/archive-2009-04/0668.shtml
>
> It seems that no-one has answered Sergey on his patch submission back
> in 2009. (According to haxx.se, that thread ends right there.)
>
> The patch removes a try-import-except-import thing and replaces it with
> a straightforward 'from subprocess import Popen,PIPE'. AFAICT that works
> almost everywhere and is a good change.
>
> So, if there are no vetos, I'll commit this patch.

I believe the patch is not correct. It assumes unlimited buffering on
the stdout and stderr pipes, which is never the case. The way Popen is
used on the patch can cause the parent and child processes to deadlock.

I suggest using Popen.communicate instead.

See:
http://docs.python.org/2.7/library/subprocess.html#subprocess.Popen.wait

-- Brane