question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dict generation no more working following PyGlossary 4.3.0 upgrade

See original GitHub issue

PyGlossary was upgraded to 4.3.0 in #1154. Since then the GitHub action to update dictionnaries does not work anymore:

$ pyglossary --ui=none data/no/dict-no.df dict-data.ifo
[INFO] Automatically switching to SQLite mode for writing Stardict
[CRITICAL] Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.9.9/x64/bin/pyglossary", line 8, in <module>
    sys.exit(main())
  File "/opt/hostedtoolcache/Python/3.9.9/x64/lib/python3.9/site-packages/pyglossary/ui/main.py", line 724, in main
    sys.exit(0 if base_ui_run(**runKeywordArgs) else 1)
  File "/opt/hostedtoolcache/Python/3.9.9/x64/lib/python3.9/site-packages/pyglossary/ui/main.py", line 191, in base_ui_run
    glos.convert(
  File "/opt/hostedtoolcache/Python/3.9.9/x64/lib/python3.9/site-packages/pyglossary/glossary.py", line 1383, in convert
    sort, direct = self._resolveConvertSortParams(
  File "/opt/hostedtoolcache/Python/3.9.9/x64/lib/python3.9/site-packages/pyglossary/glossary.py", line 1323, in _resolveConvertSortParams
    if self._switchToSQLite(inputFilename, outputFormat, writeOptions):
  File "/opt/hostedtoolcache/Python/3.9.9/x64/lib/python3.9/site-packages/pyglossary/glossary.py", line 1276, in _switchToSQLite
    self._data = SqList(
  File "/opt/hostedtoolcache/Python/3.9.9/x64/lib/python3.9/site-packages/pyglossary/sqlist.py", line 38, in __init__
    self._con = connect(filename)
sqlite3.OperationalError: unable to open database file

Exception ignored in: <function SqList.__del__ at 0x7f30ae36c820>
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.9.9/x64/lib/python3.9/site-packages/pyglossary/sqlist.py", line 155, in __del__
    self.close()
  File "/opt/hostedtoolcache/Python/3.9.9/x64/lib/python3.9/site-packages/pyglossary/sqlist.py", line 146, in close
    if self._con is None:
AttributeError: 'SqList' object has no attribute '_con'

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:17 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
iliuscommented, Jan 28, 2022

Also tested on Python 3.8 and doesn’t make much difference memory-wise. So I removed gc.collect() https://github.com/ilius/pyglossary/commit/8a09e5c452c23ced19c562b3697a337d81125dd6

1reaction
iliuscommented, Jan 28, 2022

@BoboTiG Thanks for letting me know. I will add a config and flag to disable the GC.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Releases · ilius/pyglossary - GitHub
A tool for converting dictionary files aka glossaries. Mainly to help use our offline glossaries in any Open Source dictionary we like on...
Read more >
Create a Dictionary in Python – Python Dict Methods
In this article, you will learn the basics of dictionaries in Python. You will learn how to create dictionaries, access the elements inside ......
Read more >
Dictionaries in Python - Real Python
In this Python dictionaries tutorial, you'll cover the basic characteristics and learn how to access and manage dictionary data. Once you have finished...
Read more >
python - Create a dictionary with comprehension
Python supports dict comprehensions, which allow you to express the creation of dictionaries at runtime using a similarly concise syntax. A dictionary ......
Read more >
Data Structures (Part II): Dictionaries - Python Like You Mean It
Python's dictionary allows you to store key-value pairs, and then pass the ... keep track of whether or not a 3D coordinate fell...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found