build_i18n doesn't work on Windows

Bug #1152913 reported by Bernhard Reiter
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-distutils-extra
Opinion
Undecided
Unassigned

Bug Description

I'm using python-distutils-extra for Gourmet Recipe Manager successfully under Linux [1], and I'd also like to use it under Windows (where I'm generating an .exe by means of py2exe). This works kinda well, except for the build_i18n target, where p-d-e calls intltool-update, intltool-merge, and msgfmt. While they're all on my Windows path (as they come as part of the latest PyGTK all-in-one installer package), only msgfmt is successfully run by p-d-e, as it is an actual .exe file, while the intltool-* ones are not.

I have of course installed perl, and tried some tricks [3,4] to at least convince the command prompt and Powershell, respectively, that just typing intltool-update and hitting Enter will run that perl script, but unfortunately, that doesn't seem to have any effect on its invocation by p-d-e via self.spawn(cmd).

[1] https://github.com/thinkle/gourmet/blob/master/setup.py
[2] http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.24/
[3] http://stackoverflow.com/questions/4727480/how-do-i-make-my-perl-scripts-act-like-normal-programs-on-windows
[4] http://docs.activestate.com/activeperl/5.10/bin/pl2bat.html

Revision history for this message
Sebastian Heinlein (glatzor) wrote : Re: [Bug 1152913] [NEW] build_i18n doesn't work on Windows

Unfortunately distutils.spawn.find_executables() requires the .exe file
extension on Windows.

So if you rename intltool-update to intltool-update.exe it should work -
just by looking at the code since I don't have got a Windows system at
my handy.

Revision history for this message
Bernhard Reiter (ockham-razor) wrote :

Am Samstag, den 09.03.2013, 17:13 +0000 schrieb Sebastian Heinlein:
> Unfortunately distutils.spawn.find_executables() requires the .exe file
> extension on Windows.

I'm not so sure about that as I think I successfully tried
distutils.util.spawn(["perl","C:/path-to-intltool/intltool-update"])
(being under Linux right now, too).

> So if you rename intltool-update to intltool-update.exe it should work -
> just by looking at the code since I don't have got a Windows system at
> my handy.

I was thinking about changing that line into something like above, as it
should also work under Linux with perl being called explicitly. The
remaining question then is how to specify the path to intltool-update in
a cross-compatible fashion. (Note that I was wrong about its location
being on my windows path. Conversely, C:/Program
Files/Python27/Lib/site-packages/gtk-2.0 is on my *Python* path, with
intltool in its runtime/bin/ subfolder.)

Revision history for this message
Sebastian Heinlein (glatzor) wrote :

Am Samstag, den 09.03.2013, 18:00 +0000 schrieb Bernhard Reiter:
> Am Samstag, den 09.03.2013, 17:13 +0000 schrieb Sebastian Heinlein:
> > Unfortunately distutils.spawn.find_executables() requires the .exe file
> > extension on Windows.
>
> I'm not so sure about that as I think I successfully tried
> distutils.util.spawn(["perl","C:/path-to-intltool/intltool-update"])
> (being under Linux right now, too).

Please have a look at the source code of the
distutils.spawn.find_executables() function: if the command hasn't got
a .exe suffix it will append it. There must be a perl.exe on you system.

> > So if you rename intltool-update to intltool-update.exe it should work -
> > just by looking at the code since I don't have got a Windows system at
> > my handy.
>
> I was thinking about changing that line into something like above, as it
> should also work under Linux with perl being called explicitly. The
> remaining question then is how to specify the path to intltool-update in
> a cross-compatible fashion. (Note that I was wrong about its location
> being on my windows path. Conversely, C:/Program
> Files/Python27/Lib/site-packages/gtk-2.0 is on my *Python* path, with
> intltool in its runtime/bin/ subfolder.)

Renaming the installed intltool-update to intltool-update.exe should be
the correct fix.

Changed in python-distutils-extra:
status: New → Invalid
status: Invalid → Opinion
Revision history for this message
Saxon Shuttleworth (saxons) wrote :

Bernhard, I am seeing the same issues with intltool-* when trying to build Gourmet Recipe Manager on Windows 10. What steps did you take to resolve this issue?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.