On 26 Jan 2021, Daniel Shahaf wrote:
>Yay!  *gestures* Here's your old chair, right where you left it; I think you'll
>find the only difference from when you last occupied it is that your DHCP lease
>may have expired ;-)

:laugh+cry emoji:    :­)

>AFAICT:
>
>1. SVN_TEST_PYTHON is only used by the svneditor.bat, not by anything else in
>the test suite.
>
>2. When «make check» invokes foo_tests.py, it doesn't _execute_ it but
>_imports_ it, so the #! line doesn't even come into play at all.  (See
>build/run_tests.py)

Thank you!  Got it.

>The test suite should never run its own auxiliary Python scripts with
>«/usr/bin/env python»; rather, it should use sys.executable.  There's precedent
>for this throughout the test suite.
>
>> So, one solution would be to just commit this change...
>> 
>>   Index: subversion/tests/cmdline/svntest/main.py
>>   ===================================================================
>>   --- subversion/tests/cmdline/svntest/main.py       (revision 1885910)
>>   +++ subversion/tests/cmdline/svntest/main.py       (working copy)
>>   @@ -129,7 +129,8 @@
>>    if windows:
>>      svneditor_script = os.path.join(sys.path[0], 'svneditor.bat')
>>    else:
>>   -  svneditor_script = os.path.join(sys.path[0], 'svneditor.py')
>>   +  svneditor_script =  sys.executable + " " + \
>>   +                      os.path.join(sys.path[0], 'svneditor.py')
>>    
>>    # Username and password used by the working copies
>>    wc_author = 'jrandom'
>> 
>> ...which, somewhat to my surprise, seems to work :-), at least with 
>> preliminary testing.  I'd run it through the full test suite before 
>> committing, of course.
>> 
>> Another solution would be to create a 'svneditor.sh' that just runs 
>> '${SVN_TEST_PYTHON} /path/to/svneditor.py $@'.
>
>Compare create_python_hook_script() — which, incidentally, isn't careful about
>using proper shell quoting where needed (or ensuring the value is safe to use
>unquoted).
>
>> I'm posting to get others' thoughts on how best to solve this.  If the above
>> patch looks good, let me know and I'll test & commit it.
>
>+1 to using sys.executable.  Fixing the quoting while in there would be nice to
>have, but as it's not a regression it's not a blocker either.  Happy to leave
>the details to you.

+1.  I'll look at create_python_hook_script(), make the necessary adjustments 
to my patch (and maybe in create_python_hook_script() as well), and commit.

Thanks, Daniel.

Best regards,
-Karl

Reply via email to