polib.py raise a IOException when po file has a commented line in blank

Bug #1068577 reported by aberlanas
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
polib (Ubuntu)
Fix Released
Medium
Angel Abad

Bug Description

If the po file contains a empty comment line, for example:

#. The next line is commented
#.
#. This also

The parser raise a IO exception.

Ubuntu version:
Distributor ID: Ubuntu
Description: Ubuntu 12.04.1 LTS
Release: 12.04
Codename: precise

Tags: patch
Revision history for this message
aberlanas (angel-berlanas) wrote :

Simple path to solve the problem

description: updated
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "simpleParserForComments.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Angel Abad (angelabad)
Changed in polib (Ubuntu):
assignee: nobody → Angel Abad (angelabad)
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
izi (izimobil) wrote :

Hi (I'm the polib author),

I'm a bit confused by the patch since it doesn't fix the described issue, the patch is on the flagline (#,) code block and the issue is related to comments (#.).

I'll have look at this and will release a bugfix version.

Revision history for this message
aberlanas (angel-berlanas) wrote :

Correct, the patch is wrong: (sorry)

this is the line

elif tokens[0] == '#.' and nb_tokens > 1:

must be:

elif tokens[0] == '#.' :

Angel Abad (angelabad)
Changed in polib (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
izi (izimobil) wrote :

Fixed upstream, new release 1.0.2 published.
http://pypi.python.org/pypi/polib/1.0.2

Regards.

Revision history for this message
Angel Abad (angelabad) wrote :

Hi, In Ubuntu we are in frozen, Ill upload to Debian and wait for sync.

izi, do you think this patch is than important to update Ubuntu stables, and Debian freeze distributions?

Cheers,

Changed in polib (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
izi (izimobil) wrote :

Not important IMO, empty generated comments are pretty rare...

Revision history for this message
aberlanas (angel-berlanas) wrote :

Thanks for all!

Revision history for this message
Angel Abad (angelabad) wrote :

Version 1.0.2-1 uploaded to raring:

- https://launchpad.net/ubuntu/raring/+source/polib/1.0.2-1

Cheers,

Changed in polib (Ubuntu):
status: Fix Committed → Fix Released
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.