Re: [Distutils] _spawn_posix fails, command line works??

"John J. Lee" <jjl@pobox.com> writes:
Is this problem my fault, or distutils'?
After reading Rene's reply, I'd say probably yours. But I'm not sure.
Can we see it anyway? Cheers, M. -- 40. There are two ways to write error-free programs; only the third one works. -- Alan Perlis, http://www.cs.yale.edu/homes/perlis-alan/quotes.html

On 24 Jan 2002, Michael Hudson wrote:
Sorry, would have posted the solution to the list before if I'd noticed Jack Jansen's reply to me was only emailed... it was simply the same problem that you were having, Michael. Something along the lines of: the windows implementation goes through the shell (or cmd.com or whatever it is -- though I was using cygwin + mingw gcc at the time), and the posix impl. uses execvp, so there's no quoting of backslashes needed. This should be fixed in distutils, I think, probably in _nt_quote_args. I suppose any fix should be tested with the various mingw / cygwin and command.com / bash combinations.
Don't have it with me, will post it later if it hasn't been sorted out by then. John

On 24 Jan 2002, Michael Hudson wrote:
The relevant bit: from distutils.core import setup, Extension ext_modules = [] c_libraries = [] ... if os.name == "nt": fmt = '\\"%s\\"' elif os.name == "posix": fmt = '\"%s\"' macros = [ ("HAVE_CONFIG_H", 1), ("LOCALEDIR", fmt % (os.environ.get("localedir", ""),)), ("GNULOCALEDIR", fmt % (os.environ.get("gnulocaledir", ""),)), ("LOCALE_ALIAS_PATH", fmt % (os.environ.get("aliaspath", ""),)) ] # libintl (gettext) static lib srcs = glob(join("win", "intl", "*.c")) srcs.remove(join("win", "intl", "cat-compat.c")) intlsrcs = srcs # recode static lib srcs = glob(join("win", "src", "*.c")) srcs.remove(join("win", "src", "ansi2knr.c")) srcs.extend(intlsrcs) lib = "recode", {"sources": srcs, "include_dirs": include_dirs, "macros": macros} c_libraries.append(lib) ... As for a fix for for windows implementation, I don't have the knowledge to say how this should be done in the general case. John

On 24 Jan 2002, Michael Hudson wrote:
Sorry, would have posted the solution to the list before if I'd noticed Jack Jansen's reply to me was only emailed... it was simply the same problem that you were having, Michael. Something along the lines of: the windows implementation goes through the shell (or cmd.com or whatever it is -- though I was using cygwin + mingw gcc at the time), and the posix impl. uses execvp, so there's no quoting of backslashes needed. This should be fixed in distutils, I think, probably in _nt_quote_args. I suppose any fix should be tested with the various mingw / cygwin and command.com / bash combinations.
Don't have it with me, will post it later if it hasn't been sorted out by then. John

On 24 Jan 2002, Michael Hudson wrote:
The relevant bit: from distutils.core import setup, Extension ext_modules = [] c_libraries = [] ... if os.name == "nt": fmt = '\\"%s\\"' elif os.name == "posix": fmt = '\"%s\"' macros = [ ("HAVE_CONFIG_H", 1), ("LOCALEDIR", fmt % (os.environ.get("localedir", ""),)), ("GNULOCALEDIR", fmt % (os.environ.get("gnulocaledir", ""),)), ("LOCALE_ALIAS_PATH", fmt % (os.environ.get("aliaspath", ""),)) ] # libintl (gettext) static lib srcs = glob(join("win", "intl", "*.c")) srcs.remove(join("win", "intl", "cat-compat.c")) intlsrcs = srcs # recode static lib srcs = glob(join("win", "src", "*.c")) srcs.remove(join("win", "src", "ansi2knr.c")) srcs.extend(intlsrcs) lib = "recode", {"sources": srcs, "include_dirs": include_dirs, "macros": macros} c_libraries.append(lib) ... As for a fix for for windows implementation, I don't have the knowledge to say how this should be done in the general case. John
participants (2)
-
John J. Lee
-
Michael Hudson