Error with Python dictionaries

24 views
Skip to first unread message

Noelia

unread,
Apr 7, 2021, 1:29:43 PM4/7/21
to plove...@googlegroups.com
Hello, today I'm getting the following errors using a system which
contains Python dictionaries. Before I didn't have issues with this.
What can I do to fix them?
I've deleted the plover subfolder contained in
C:\Users\ESTENOTIPIA_1\AppData\Local to configure Plover again, using
portable and an installed copy, without success.
Here are notifications:

Plover. ERROR: loading dictionary `spanish_mqd_single.py` failed:
'charmap' codec can't decode byte 0x81 in position 394208: character
maps to <undefined>. . Recibido a las 19:26

Plover. ERROR: loading dictionary `spanish_mqd_double.py` failed: name
'__file__' is not defined. . Recibido a las 19:26

Today I've downloaded the artifact generated by the last run of GitHub
Actions trying to configure it to use my plugin: spanish_mqd,
available at

https://github.com/nvdaes/plover_spanish_mqd

This morning I've being writing more than 4 hours with Plover, but now
it's not possible.
Thanks for your help.

Benoit Pierre

unread,
Apr 7, 2021, 2:54:35 PM4/7/21
to ploversteno
On Wed, Apr 7, 2021 at 7:29 PM Noelia <nrm...@gmail.com> wrote:
Hello, today I'm getting the following errors using a system which
contains Python dictionaries. Before I didn't have issues with this.
What can I do to  fix them?

Can you update the Python dictionary plugin (I just released a new version: 1.0.0), and report if the issue persists.
 
Cheers,

--
A: Because it destroys the flow of conversation.
Q: Why is top posting dumb?

Noelia

unread,
Apr 7, 2021, 3:45:06 PM4/7/21
to plove...@googlegroups.com
Benoit Pierre<benoit...@gmail.com>
7 de abril de 2021, 20:54 wrote:

> Can you update the Python dictionary plugin (I just released a new version: 1.0.0), and report if the issue persists.

I've updated the Python dictionary plugin and the issue is fixed. 👍

Thanks so much!
> --
> You received this message because you are subscribed to the Google Groups
> "Plover" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ploversteno...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ploversteno/CA%2BSSzV2ACXqcxTrcrhLOhya1AyR64%3D1VK9PsyS4rkYSpURPqKA%40mail.gmail.com.
>

Noelia

unread,
Apr 8, 2021, 2:49:16 AM4/8/21
to plove...@googlegroups.com
Hello again, I'm testing in a different computer and one of the Python
dictionaries is working properly:

https://github.com/nvdaes/plover_spanish_mqd/blob/main/plover_spanish_mqd/dictionaries/spanish_mqd_single.py

But the other one is not recognized:

https://github.com/nvdaes/plover_spanish_mqd/blob/main/plover_spanish_mqd/dictionaries/spanish_mqd_double.py

A notification is triggered reflecting that name of this file is not defined.

I need to remove imports so that the dictionary can be added, but in
this case I cannot use its functionality. It imports the first
dictionary to use a global variable. This may be fixed from my part
using the new added expression "{=(?i)...}", but today I'll have to
write without this second dictionary.
Not sure what's happening, maybe a Windows update, since I have go
back to a previous prerelease of Plover.
Hope this can be fixed.

Thanks

2021-04-07 20:54 GMT+02:00, Benoit Pierre <benoit...@gmail.com>:

Benoit Pierre

unread,
Apr 8, 2021, 2:15:01 PM4/8/21
to ploversteno
On Thu, Apr 8, 2021 at 8:49 AM Noelia <nrm...@gmail.com> wrote:
[...]


I need to remove imports so that the dictionary can be added, but in
this case I cannot use its functionality. It imports the first
dictionary to use a global variable. This may be fixed from my part
using the new added expression "{=(?i)...}", but today I'll have to
write without this second dictionary.

This on top of the second dictionary does raise a lot of warning bells:

import sys
sys.path.append(os.path.dirname(__file__))
import spanish_mqd_single
del sys.path[-1]
import os

The old implementation might have allowed those kind of hacks, but that does not mean they are supported.

Python dictionaries are special in that they are re-loadable, but Python modules are not. So an inter-dependency like that between 2 dictionaries is a big no-no: there's no guarantee the dictionaries will be loaded in a particular order, or that loading a Python dictionary will result in a module of the same name being imported (that was an implementation detail of the old version).

Now, I'd like to understand your use-case, please create an issue on https://github.com/benoit-pierre/plover_python_dictionary with more information.

Not sure what's happening, maybe a Windows update, since I have go
back to a previous prerelease of Plover.

Or downgrade to plover-python-dictionary<=0.5.10
 
Cheers,

Noelia

unread,
Apr 8, 2021, 3:13:20 PM4/8/21
to plove...@googlegroups.com
Benoit Pierre<benoit...@gmail.com> 8 de abril de 2021, 20:14 wrote:

>Now, I'd like to understand your use-case, please create an issue on https://github.com/benoit-pierre/plover_python_dictionary with more information.

Done, thanks a lot.

https://github.com/benoit-pierre/plover_python_dictionary/issues/5

Cheers
> --
> You received this message because you are subscribed to the Google Groups
> "Plover" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ploversteno...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ploversteno/CA%2BSSzV2kZA0fh2%3DH%2BxB2vFwbDnegT4L5GjY%3DHS9ZTV5wEOZ%3DEw%40mail.gmail.com.
>
Reply all
Reply to author
Forward
0 new messages