Comments (6)
Original comment by David Jean Louis (Bitbucket: izi, GitHub: izi):
I still do not reproduce this issue, all entries starting with "#." are correctly parsed.
That said, "#~|" fails, but this is another issue reported here: #28/ioerror-on-reading-obsolete-previous-msgid
Please (@og Maciel, @rachidbm) if you still reproduce the issue with "#." try to post a reproducible case with a description of your environment (os, python version, etc.).
Thanks a lot !
from polib.
Original comment by rachidbm (Bitbucket: rachidbm, GitHub: rachidbm):
I got the same error again when the .po file contains comment like: #~|
It works when I changed a statement to:
elif (tokens[0] == '#.' or tokens[0] == '#~|') and nb_tokens >= 1:
Don't know if this will break something else, but for me polib is usable again :)
from polib.
Original comment by rachidbm (Bitbucket: rachidbm, GitHub: rachidbm):
I think I have almost the same problem in polib 0.7. When the .po file contains the line "#." parse() terminates with the error:
#!bash
File "/usr/lib/python2.7/dist-packages/polib.py", line 102, in pofile
return _pofile_or_mofile(pofile, 'pofile', **kwargs)
File "/usr/lib/python2.7/dist-packages/polib.py", line 73, in _pofile_or_mofile
instance = parser.parse()
File "/usr/lib/python2.7/dist-packages/polib.py", line 1250, in parse
self.process('??', i)
File "/usr/lib/python2.7/dist-packages/polib.py", line 1313, in process
raise IOError('Syntax error in po file (line %s)' % linenum)
IOError: Syntax error in po file (line 4202)
from polib.
Original comment by Og Maciel (Bitbucket: omaciel, GitHub: omaciel):
If filename is http://l10n.gnome.org/POT/gnome-terminal.master/gnome-terminal.master.zh_TW.po which is saved locally, then:
In [13]: po = pofile(filename, autodetect_encoding=True, encoding='utf-8')
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (607, 0))
IOError Traceback (most recent call last)
/Library/Python/2.7/site-packages/django/core/management/commands/shell.pyc in ()
----> 1 po = pofile(filename, autodetect_encoding=True, encoding='utf-8')
/Library/Python/2.7/site-packages/polib.pyc in pofile(pofile, **kwargs)
100 file (optional, default: False
).
101 """
--> 102 return _pofile_or_mofile(pofile, 'pofile', **kwargs)
103
104 # `
/Library/Python/2.7/site-packages/polib.pyc in _pofile_or_mofile(f, type, **kwargs)
71 check_for_duplicates=kwargs.get('check_for_duplicates', False)
72 )
---> 73 instance = parser.parse()
74 instance.wrapwidth = kwargs.get('wrapwidth', 78)
75 return instance
/Library/Python/2.7/site-packages/polib.pyc in parse(self)
1248
1249 else:
-> 1250 self.process('??', i)
1251
1252 if self.current_entry:
/Library/Python/2.7/site-packages/polib.pyc in process(self, symbol, linenum)
1311 self.current_state = state
1312 except Exception:
-> 1313 raise IOError('Syntax error in po file (line %s)' % linenum)
1314
1315 # state handlers
IOError: Syntax error in po file (line 2143)
In [17]: polib.version
Out[17]: '0.7.0'
The contents for line 2143 show:
#. Translators: This is the label of a menu item to choose a profile.
#. * %c is used as the accelerator (it will be a character between A and Z),
#. * and the %s is the name of the terminal profile.
#.
#: ../src/terminal-window.c:483
#, c-format
msgid "%c. %s"
msgstr "_%c. %s"
from polib.
Original comment by David Jean Louis (Bitbucket: izi, GitHub: izi):
I can't reproduce the error with the given sample data...
Please be more explicit, what is the error message ? which version of polib are you running ? etc.
from polib.
Close this historic issue
from polib.
Related Issues (20)
- (Un)escape more characters HOT 1
- (faulty issue)
- _BaseEntry/POEntry constructors have bad signatures HOT 1
- New release?
- Drop py<=3.6 and clean up/modernize the code?
- Trying to open a non-existant .po file gives incorrect error HOT 3
- sdist is missing tox.ini
- List of occurrences wrapped differently than xgettext
- "OSError: Syntac Error" when file not found HOT 2
- How to wrap the "msgstr" with the specified width? HOT 2
- [question] How to get same behaviour of po4a in wrap? HOT 3
- Docu: Icons missing
- Docu: Dead link
- Docu: _BaseFile class not documented via Sphinx
- Docu: POEntry.__init__() docstring not in Sphinx output
- Please add support for extracted comments HOT 4
- Add ignore_errors parameter to polib.pofile
- Does polib compile into mo wihout "msgfmt"? HOT 6
- test_save_as_mofile fails with gettext 0.22+ HOT 1
- DeprecationWarning: It is deprecated to return a value that is not None from a test cas
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from polib.