[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Use subprocess.Popen for executing commands in cmdline tests

From: Daniel Shahaf <d.s_at_daniel.shahaf.co.il>
Date: Sat, 19 Apr 2008 13:25:25 +0300 (Jerusalem Daylight Time)

jeremy hinds wrote on Fri, 18 Apr 2008 at 19:01 -0600:
> I started working on getting a Windows dev environment set up so I can
> at least make sure things can be expected to work before asking for
> anybody else's time to test it. But I'm not quite there yet. In the
> meantime, if someone else happens to get a chance to look at it, that
> would be great.
>

I'm getting this error with your patch on Windows (ra_svn fsfs
VC9Express):

START: changelist_tests.py
CMD: svnadmin.exe create svn-test-work\local_tmp\repos --bdb-txn-nosync --fs-type=fsfs
Traceback (most recent call last):
  File "F:\Data\Unzip\svn\subversion/tests/cmdline/changelist_tests.py", line 885, in <module>
    svntest.main.run_tests(test_list)
  File "F:\Data\Unzip\svn\subversion\tests\cmdline\svntest\main.py", line 1386, in run_tests
    actions.setup_pristine_repository()
  File "F:\Data\Unzip\svn\subversion\tests\cmdline\svntest\actions.py", line 44, in setup_pristine_repository
    main.create_repos(main.pristine_dir)
  File "F:\Data\Unzip\svn\subversion\tests\cmdline\svntest\main.py", line 581, in create_repos
    path, *opts)
  File "F:\Data\Unzip\svn\subversion\tests\cmdline\svntest\main.py", line 309, in run_command
    None, *varargs)
  File "F:\Data\Unzip\svn\subversion\tests\cmdline\svntest\main.py", line 398, in run_command_stdin
    *varargs)
  File "F:\Data\Unzip\svn\subversion\tests\cmdline\svntest\main.py", line 365, in spawn_process
    infile, outfile, errfile, kid = open_pipe(cmd_argv, binary_mode)
  File "F:\Data\Unzip\svn\subversion\tests\cmdline\svntest\main.py", line 326, in open_pipe
    stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True)
  File "E:\Python\lib\subprocess.py", line 551, in __init__
    raise ValueError("close_fds is not supported on Windows "
ValueError: close_fds is not supported on Windows platforms
END: changelist_tests.py

(The error repeats for every *_tests.py file.)

Python docs agree: (http://docs.python.org/lib/node528.html)

    "If close_fds is true, all file descriptors except 0, 1 and 2 will
    be closed before the child process is executed. (Unix only)"
                                                    ^^^^^^^^^^^

Daniel

>
>
> On Fri, Apr 18, 2008 at 6:35 AM, Branko Čibej <brane_at_xbc.nu> wrote:
> > Daniel Shahaf wrote:
> >
> > > jeremy hinds wrote on Wed, 9 Apr 2008 at 22:49 -0600:
> > >
> > >
> > > > 2008/4/8 jeremy hinds <jeremy.hinds_at_gmail.com>:
> > > >
> > > >
> > > > > Thanks for clearing that up. While rewriting the patch to handle
> > > > > universal_newlines and shell=False, another question came up.
> > > > >
> > > > > I made universal_newlines apply on any platform rather than just
> > > > > Windows, and that seemed to work fine on everything except
> > > > > import_tests.import_eol_style(). The problem is that
> > > > > run_and_verify_svn() has text mode hard-coded in it, so the "\r\n"
> > > > > sequences were converted to "\n". (Honestly, I don't understand how
> > > > > that test worked accurately on Windows before.)
> > > > >
> > > > > The question is whether it is better to preserve old behavior by
> > never
> > > > > using universal_newlines on posix, or should I add a "binary_mode"
> > > > > parameter to run_and_verify_svn2()?
> > > > >
> > > > >
> > > > >
> > > > I decided err on the side of flexibility and add a "binary_mode" param
> > > > to run_and_verify_svn2(). So here is my new and improved (and
> > > > hopefully good) patch. Again, I've only been able to test this on
> > > > Linux.
> > > >
> > > > [[[
> > > > In cmdline tests, use subprocess.Popen for executing commands to allow
> > > > support for exit-code checks on both Windows and posix systems. This
> > makes
> > > > the test suite require Python version >= 2.4.
> > > >
> > > >
> > > >
> > >
> > > Ping. Has anyone reviewed the binary_mode changes? Could someone verify
> > that the patch works on Windows too?
> > >
> > >
> >
> > Oh sorry. Looks good to me. I can't test on Windows these days, sorry.
> >
> > -- Brane
> >
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-04-22 07:14:23 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.