Hey, I was looking at numpy/distutils/ccompiler.py and noticed that it has a fix for distutils.util.split_quoted. Here is the relevant code from split_quoted in numpy.distutils.ccompiler: ----------------------------------- def split_quoted(s): <snip> if _has_white_re.search(s[beg+1:end-1]): s = s[:beg] + s[beg+1:end-1] + s[end:] pos = m.end() - 2 else: # Keeping quotes when a quoted word does not contain # white-space. XXX: send a patch to distutils pos = m.end() <snip> ----------------------------------- Here is the relevant code from split_quoted in distutils.util: ----------------------------------- def split_quoted(s): <snip> s = s[:beg] + s[beg+1:end-1] + s[end:] pos = m.end() - 2 <snip> ----------------------------------- Does anyone know if a patch was ever submitted upstream? If not, is there any reason that a patch shouldn't be submitted? Thanks, -- Jarrod Millman Computational Infrastructure for Research Labs 10 Giannini Hall, UC Berkeley phone: 510.643.4014 http://cirl.berkeley.edu/
Hello, I never got any reply about the 'fix' for distutils.util.split_quoted in numpy/distutils/ccompiler.py. Can anyone confirm whether this fix is correct or necessary? If so, I would like to submit a patch upstream for this. Thanks, On Oct 29, 2007 2:17 AM, Jarrod Millman <millman@berkeley.edu> wrote:
Hey,
I was looking at numpy/distutils/ccompiler.py and noticed that it has a fix for distutils.util.split_quoted.
Here is the relevant code from split_quoted in numpy.distutils.ccompiler: ----------------------------------- def split_quoted(s):
<snip>
if _has_white_re.search(s[beg+1:end-1]): s = s[:beg] + s[beg+1:end-1] + s[end:] pos = m.end() - 2 else: # Keeping quotes when a quoted word does not contain # white-space. XXX: send a patch to distutils pos = m.end()
<snip> -----------------------------------
Here is the relevant code from split_quoted in distutils.util: ----------------------------------- def split_quoted(s):
<snip>
s = s[:beg] + s[beg+1:end-1] + s[end:] pos = m.end() - 2
<snip> -----------------------------------
Does anyone know if a patch was ever submitted upstream? If not, is there any reason that a patch shouldn't be submitted?
Thanks,
-- Jarrod Millman Computational Infrastructure for Research Labs 10 Giannini Hall, UC Berkeley phone: 510.643.4014 http://cirl.berkeley.edu/
-- Jarrod Millman Computational Infrastructure for Research Labs 10 Giannini Hall, UC Berkeley phone: 510.643.4014 http://cirl.berkeley.edu/
On Nov 18, 2007, at 23:30 , Jarrod Millman wrote:
Hello,
I never got any reply about the 'fix' for distutils.util.split_quoted in numpy/distutils/ccompiler.py. Can anyone confirm whether this fix is correct or necessary? If so, I would like to submit a patch upstream for this.
My opinion is that it's not necessary, or correct. The fix leaves quotes in if there is no whitespace, so '"Hi"' is converted to ['"Hi"'], while '"Hi there"' becomes ['Hi there']. I can't see when you'd want that behaviour. Also, it's only used by ccompiler (numpy.distutils.ccompiler replaces the version in distutils.ccompiler). numpy.distutils.fcompiler *doesn't* use this version, it uses distutils.utils.split_quoted. Since we run into more variety in terms of command lines with the Fortran compilers than the C compilers I think, and haven't been bitten by supposedly-bad quoting problems, I'll say we don't need our version.
On Oct 29, 2007 2:17 AM, Jarrod Millman <millman@berkeley.edu> wrote:
Hey,
I was looking at numpy/distutils/ccompiler.py and noticed that it has a fix for distutils.util.split_quoted.
Here is the relevant code from split_quoted in numpy.distutils.ccompiler: ----------------------------------- def split_quoted(s):
<snip>
if _has_white_re.search(s[beg+1:end-1]): s = s[:beg] + s[beg+1:end-1] + s[end:] pos = m.end() - 2 else: # Keeping quotes when a quoted word does not contain # white-space. XXX: send a patch to distutils pos = m.end()
<snip> -----------------------------------
Here is the relevant code from split_quoted in distutils.util: ----------------------------------- def split_quoted(s):
<snip>
s = s[:beg] + s[beg+1:end-1] + s[end:] pos = m.end() - 2
<snip> -----------------------------------
Does anyone know if a patch was ever submitted upstream? If not, is there any reason that a patch shouldn't be submitted?
Thanks,
-- Jarrod Millman Computational Infrastructure for Research Labs 10 Giannini Hall, UC Berkeley phone: 510.643.4014 http://cirl.berkeley.edu/
-- Jarrod Millman Computational Infrastructure for Research Labs 10 Giannini Hall, UC Berkeley phone: 510.643.4014 http://cirl.berkeley.edu/ _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
-- |>|\/|< /------------------------------------------------------------------\ |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ |cookedm@physics.mcmaster.ca
On Nov 19, 2007 6:09 PM, David M. Cooke <cookedm@physics.mcmaster.ca> wrote:
My opinion is that it's not necessary, or correct. The fix leaves quotes in if there is no whitespace, so '"Hi"' is converted to ['"Hi"'], while '"Hi there"' becomes ['Hi there']. I can't see when you'd want that behaviour.
Also, it's only used by ccompiler (numpy.distutils.ccompiler replaces the version in distutils.ccompiler). numpy.distutils.fcompiler *doesn't* use this version, it uses distutils.utils.split_quoted. Since we run into more variety in terms of command lines with the Fortran compilers than the C compilers I think, and haven't been bitten by supposedly-bad quoting problems, I'll say we don't need our version.
I think you are right, so I went ahead and removed the code: http://scipy.org/scipy/numpy/changeset/4481 Both NumPy and SciPy build just fine on my system. If anyone has any problems, please let me know ASAP. Thanks, -- Jarrod Millman Computational Infrastructure for Research Labs 10 Giannini Hall, UC Berkeley phone: 510.643.4014 http://cirl.berkeley.edu/
participants (2)
-
David M. Cooke
-
Jarrod Millman