You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-dev@quetz.apache.org by Jim Gallacher <jp...@jgassociates.ca> on 2005/11/16 22:43:59 UTC

Re: svn commit: r345126 - /httpd/mod_python/trunk/test/test.py

nlehuen@apache.org wrote:
> Author: nlehuen
> Date: Wed Nov 16 13:15:06 2005
> New Revision: 345126
> 
> URL: http://svn.apache.org/viewcvs?rev=345126&view=rev
> Log:
> Perform quoting AFTER the test for file existence... Otherwise with spaces in Apache path, the test for file existence will always fail since the system call with be done with the quotes (tested under Win32).

Yes, of course. I wasn't thinking there.

Would it be more logical to shift the quoteIfSpace call out of 
get_ab_path and back into test_global_lock?

The quotes are required to create the cmd string in that function and 
are not part of ab_path after all. Since we can't be sure how 
get_ab_path might be used in the future, it may be best to leave the 
quoting to the calling function.

Jim

> Modified:
>     httpd/mod_python/trunk/test/test.py
> 
> Modified: httpd/mod_python/trunk/test/test.py
> URL: http://svn.apache.org/viewcvs/httpd/mod_python/trunk/test/test.py?rev=345126&r1=345125&r2=345126&view=diff
> ==============================================================================
> --- httpd/mod_python/trunk/test/test.py (original)
> +++ httpd/mod_python/trunk/test/test.py Wed Nov 16 13:15:06 2005
> @@ -166,9 +166,9 @@
>      """ Find the location of the ab (apache benchmark) program """
>      ab = None
>      for name in ['ab', 'ab2']:
> -        path = quoteIfSpace(os.path.join(os.path.split(HTTPD)[0], name))
> +        path = os.path.join(os.path.split(HTTPD)[0], name)
>          if os.path.exists(path):
> -            ab = path
> +            ab = quoteIfSpace(path)
>              break
>  
>      return ab
> 
>