Index: cygwinccompiler.py =================================================================== --- cygwinccompiler.py (revision 67510) +++ cygwinccompiler.py (working copy) @@ -160,7 +160,9 @@ raise CompileError, msg else: # for other files use the C-compiler try: - self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + + # Quote src and object files in case of spaces in path. + qouted_src_objects = ['"' + src + '"', '-o', '"' + obj + '"'] + self.spawn(self.compiler_so + cc_args + qouted_src_objects + extra_postargs) except DistutilsExecError, msg: raise CompileError, msg Index: unixccompiler.py =================================================================== --- unixccompiler.py (revision 67510) +++ unixccompiler.py (working copy) @@ -222,8 +222,12 @@ output_filename = os.path.join(output_dir, output_filename) if self._need_link(objects, output_filename): - ld_args = (objects + self.objects + - lib_opts + ['-o', output_filename]) + # Quoting objects and output for spaces in path. + quoted_objects = ['"' + o + '"' for o in objects] + quoted_self_objects = ['"' + o + '"' for o in self.objects] + quoted_output_filename = '"' + output_filename + '"' + ld_args = (quoted_objects + quoted_self_objects + + lib_opts + ['-o', quoted_output_filename]) if debug: ld_args[:0] = ['-g'] if extra_preargs: