Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msgfmt corrupts non-translatable fields in pattern files #70

Closed
nohamelin opened this issue Nov 11, 2017 · 3 comments
Closed

msgfmt corrupts non-translatable fields in pattern files #70

nohamelin opened this issue Nov 11, 2017 · 3 comments

Comments

@nohamelin
Copy link

Spanish translator here.
First, note that I can't trigger the crash running gaupol directly in English without a local data install.
It doesn't happen with Gaupol 1.2

Steps:

  • Clone Gaupol 1.3 from repo.

  • Install in a temporary location:
    python3 setup.py clean
    mkdir -p locale/es/LC_MESSAGES
    msgfmt -cv --check-accelerators=_ po/es.po -o locale/es/LC_MESSAGES/gaupol.mo
    python3 setup.py install_data -d /tmp/gaupol

  • Here I deleted ~/.config/gaupol, to discard something attached to my specific config.

  • Run gaupol, create a empty subtitle file, run "Correct Text..."

  • Pick only the "Corregir errores frecuentes" task. Next.

  • Select the "Otro" script, and the "Errores humanos" type of errors. Between the 3 errors listed, pick only "Espacios iniciales y finales". Next.

Here I got the "Something is wrong" window, with the next traceback:


File: censored/gaupol/gaupol/util.py
Line: 44
In: call_function

    function(*args, **kwargs)

File: censored/gaupol/gaupol/assistants.py
Line: 1033
In: _correct_texts

    page.correct_texts(dummy, rows, doc)

File: censored/gaupol/gaupol/assistants.py
Line: 462
In: correct_texts

    project.correct_common_errors(indices, doc, patterns)

File: censored/gaupol/aeidon/deco.py
Line: 189
In: wrapper

    value = function(*args, **kwargs)

File: censored/gaupol/aeidon/agents/text.py
Line: 174
In: correct_common_errors

    parser.set_regex(string, flags)

File: censored/gaupol/aeidon/finder.py
Line: 182
In: set_regex

    self.pattern = re.compile(pattern, flags)

File: /usr/lib/python3.5/re.py
Line: 224
In: compile

    return _compile(pattern, flags)

File: /usr/lib/python3.5/re.py
Line: 293
In: _compile

    p = sre_compile.compile(pattern, flags)

File: /usr/lib/python3.5/sre_compile.py
Line: 536
In: compile

    p = sre_parse.parse(p, flags)

File: /usr/lib/python3.5/sre_parse.py
Line: 829
In: parse

    p = _parse_sub(source, pattern, 0)

File: /usr/lib/python3.5/sre_parse.py
Line: 437
In: _parse_sub

    itemsappend(_parse(source, state))

File: /usr/lib/python3.5/sre_parse.py
Line: 638
In: _parse

    source.tell() - here + len(this))

sre_constants.error: nothing to repeat at position 0

Environment

Platform: Linux-4.11.12-100.fc24.i686+PAE-i686-with-fedora-24-Twenty_Four
Locale: es_ES.utf_8

Versions

aeidon: 1.3
chardet: 2.2.1
enchant: 1.6.8
gaupol: 1.3
gstreamer: 1.8.3.0
gtk+: 3.20.10
pygobject: 3.20.1
python: 3.5.3

@nohamelin nohamelin changed the title Gaupol 1.3 in Spanish crashes running wizard to correct text Error with Gaupol 1.3 in Spanish running wizard to correct text Nov 11, 2017
@nohamelin
Copy link
Author

After the error I can't close the Gaupol window and I need to kill the process.

Note that Fedora 24 is an old, unsupported version.
I could try a liveDVD of the latest Fedora release one of these days if you can't replicate the problem.

@otsaloma
Copy link
Owner

otsaloma commented Nov 11, 2017

I saw this too, it's related to switching from intltool to gettext. After running python3 setup.py install_data ... you need to run python3 setup.py clean before you can run bin/gaupol. That should work around the problem, I'll add some actual fix later.

Edit: That allows you to run locally, but the installed pattern files seem broken by msgfmt? I'll look into it.

@otsaloma otsaloma changed the title Error with Gaupol 1.3 in Spanish running wizard to correct text msgfmt corrupts non-translatable fields in pattern files Nov 11, 2017
@otsaloma otsaloma added the bug label Nov 11, 2017
otsaloma added a commit that referenced this issue Nov 11, 2017
otsaloma added a commit that referenced this issue Nov 11, 2017
@nohamelin
Copy link
Author

It works fine for me now, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants