gtparse fails on this file
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PyG3T |
Won't Fix
|
High
|
Ask Hjorth Larsen |
Bug Description
When trying to use the latest trunk version (revision 65) of gtgrep on the attached file it fails
knielsen@
Traceback (most recent call last):
File "/home/
gtgrep.main()
File "/home/
cat = parse(input)
File "/home/
for chunk in chunk_iter(input, include_
File "/home/
line, msgctxt = _extract_
File "/home/
string = extract_
File "/home/
raise PoSyntaxError('%s not found. Line was: %s' % (header, line))
pyg3t.gtparse.
Changed in pyg3t: | |
assignee: | nobody → Ask Hjorth Larsen (askhl) |
status: | New → Fix Committed |
importance: | Undecided → High |
Changed in pyg3t: | |
status: | Fix Committed → Won't Fix |
Ok, so this is actually a gtparse error. The problem as I could see it is that the method extract_string does this: (header + ' "'):
if not line.startswith
but for some reason the header for the msgctxt already contains its ' "', so it can be fixed by this diff:
=== modified file 'pyg3t/gtparse.py' [headerline] + otherlines)
--- pyg3t/gtparse.py 2011-06-19 17:20:03 +0000
+++ pyg3t/gtparse.py 2011-09-14 12:37:27 +0000
@@ -430,7 +430,7 @@
return ''.join(
linepatterns = dict(comment='#',
msgid=' msgid',
msgid_plural= 'msgid_ plural' ,
msgstr= 'msgstr' ,
- msgctxt='msgctxt "',
+ msgctxt='msgctxt', # Used to be 'msgctxt "'
However, I cannot really see if there is a particular reason that it was like that.