intltool fails on reportedly bad regexp

Bug #436671 reported by Alex Launi
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
intltool
Invalid
Undecided
Unassigned

Bug Description

When I run intltool-update -m on my project, it crashes with this error message:
Invalid [] range "F-8" in regex; marked by <-- HERE in m/[encoding: UTF-8 <-- HERE ]
at /usr/bin/intltool-update line 321, <FILE> line 1.

It works fine on other files which have an identical hexdump up until the point where files start getting listed.

Revision history for this message
Alex Launi (alexlauni) wrote :

The POTFILES.in in question

Revision history for this message
Félix Velasco (felix-velasco) wrote :

intltool-update uses "encoding: UTF-8", or anything else in $file as a regexp without properly escaping special characters. Using quotemeta for escaping it works (see attached patch)

Revision history for this message
Данило Шеган (danilo) wrote :

I am unable to reproduce this with perl 5.10.0 on Ubuntu GNU/Linux. Can you let me know how this fails for you (i.e. what system, Perl version; I am assuming latest intltool version) so we know exactly who is affected. The proposed fix looks benign (well, more than that, it looks good), so I'd be happy to apply it as soon as I get more information about why it happens.

Changed in intltool:
status: New → Incomplete
Revision history for this message
Félix Velasco (felix-velasco) wrote :

I'm reproducing it in Karmic, with perl 5.10.0 and intltool 0.41.0-0ubuntu1. The easiest way is to try to build gnome-do from the repos:

$ apt-get source gnome-do
$ cd gnome-do-0.8.2+dfsg/
$ dpkg-buildpackage -b

For me, that launches a failed build, that ends with:

INTLTOOL_EXTRACT=/usr/bin/intltool-extract srcdir=. /usr/bin/intltool-update --gettext-package gnome-do --pot
rm -f missing notexist
srcdir=. /usr/bin/intltool-update -m
Invalid [] range "F-8" in regex; marked by <-- HERE in m/[encoding: UTF-8 <-- HERE ]
/ at /usr/bin/intltool-update line 321, <FILE> line 1.
make[2]: *** [check] Error 2
...
dpkg-buildpackage: error: debian/rules build entregó error de estado de salida 2

Revision history for this message
Y.Z. (y-zinch) wrote :

I can confirm same issue. Karmic, perl 5.10, intltool 0.41. Getting same problem when trying to build Gnome-Do

Revision history for this message
Félix Velasco (felix-velasco) wrote :

Danilo, are you still unable to reproduce it?

Changed in intltool:
status: Incomplete → Confirmed
Revision history for this message
dobey (dobey) wrote : Re: [Bug 436671] Re: intltool fails on reportedly bad regexp

Can you attach a test case that fails without your patch, and that works
with your patch, so that we can have a regression test? This will show
what exactly is failing, and let us determine if your fix is the right
one or if we should be doing something else instead. Thanks.

On Mon, 2010-03-08 at 14:48 +0000, Félix Velasco wrote:
> Danilo, are you still unable to reproduce it?

Revision history for this message
Félix Velasco (felix-velasco) wrote :

You mean, besides the steps of comment #4?

Revision history for this message
dobey (dobey) wrote :

"I have a problem building Gnome Do" isn't a test case. It's a statement
of personal difficulty. It doesn't specify or reproduce what is failing.

On Mon, 2010-03-08 at 16:34 +0000, Félix Velasco wrote:
> You mean, besides the steps of comment #4?

Revision history for this message
Félix Velasco (felix-velasco) wrote :

I think you're confusing comments #4 and #5, but anyway, I'm attaching a rather minimal test case.
Uncompress the attached file, and, from within the created po directory, run "intltool-update -m". Fails without the patch, works with it.

Revision history for this message
Данило Шеган (danilo) wrote :

It doesn't fail for me. Are you perhaps using some special perl parameters to make it not escape these by default?

Revision history for this message
Данило Шеган (danilo) wrote :

Btw, a minimal test case would have been POTFILES.in with just the [encoding] line.

Also, what happens on your systems with lines like [gettext/xml]something.xml.in (when something.xml.in exists or doesn't exist, both with your patch and without)?

Revision history for this message
Данило Шеган (danilo) wrote :

Ok, I've figured out what the problem is: it's not POTFILES.in at all, but POTFILES.skip: I sometimes can reproduce it, but not at all times. It probably relates to actual files existing or not.

intltool has never supported []-tags in POTFILES.skip, so that's a problem in the package (and why should it? encoding is relevant only if you are going to actually parse the file, not skip or ignore it). FWIW, the correct patch to change this would have been the attached one, but I am not considering this a bug.

Changed in intltool:
status: Confirmed → Invalid
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.