Issue 20824: setup.py install doesn't parse spaces in path (original) (raw)

When having spaces in the path which represents the root for the build on going, rpmbuild from bdist_rpm will fail:


RPM build errors: Bad exit status from /var/tmp/rpm-tmp.cbEEZl (%install) error: command 'rpmbuild' failed with exit status 1

With this patch it will work:

--- bdist_rpm-BAK.py 2014-03-02 14:52:31.501744617 +0200 +++ bdist_rpm.py 2014-03-02 14:53:10.705746243 +0200 @@ -512,8 +512,8 @@ # that we open and interpolate into the spec file, but the defaults # are just text that we drop in as-is. Hmmm.

but then another roadblock is hit:

seems stat also needs quoted path:

lex@hemvi:~/Development/4. Test/11. ARTA/build$ stat --format="%a" /home/lex/Development/4. Test/11. ARTA/build/CHANGELOG ; echo $? 755 stat: cannot stat Test/11.': No such file or directory stat: cannot stat ARTA/build/CHANGELOG': No such file or directory 1

lex@hemvi:~/Development/4. Test/11. ARTA/build$ stat --format="%a" "/home/lex/Development/4. Test/11. ARTA/build/CHANGELOG" ; echo $? 644 0

I guess all the calls need to be rewritten to take into account spaces in the path. This would be too laborious, thus perhaps we should warn in documentation packagers/developers not to use spaces in path when building?