mhwgoo / cambridge

Terminal version of Cambridge Dictionary by default. Also supports Merrian-Webster Dictionary.
GNU General Public License v3.0
50 stars 6 forks source link

Crash #8

Closed 10b14224cc closed 3 months ago

10b14224cc commented 3 months ago
➜  camb bolster

bolster verb T
UK |ˈbəʊl.stər| US |ˈboʊl.stɚ|
: to support or improve something or make it stronger
|More money is needed to bolster the industry.
|She tried to bolster my confidence/morale (= encourage me and make me feel stronger) by telling me that I had a special talent.
|They need to do something to bolster their image.

bolster noun C
UK |ˈbəʊl.stər| US |ˈboʊl.stɚ|
: a long firm cylinder-shaped pillow

FOUND "bolster" from CAMBRIDGE in cache. You can add "-f -w" to fetch the MERRIAM_WEBSTER dictionary
Traceback (most recent call last):
  File "/home/USERNAME/.pyenv/versions/cambridge/bin/camb", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/USERNAME/.pyenv/versions/3.12.2/envs/cambridge/lib/python3.12/site-packages/cambridge/main.py", line 5, in main
    args.func(args)
  File "/home/USERNAME/.pyenv/versions/3.12.2/envs/cambridge/lib/python3.12/site-packages/cambridge/args.py", line 281, in search_word
    cambridge.search_cambridge(input_word, is_fresh, is_ch, no_suggestions, None)
  File "/home/USERNAME/.pyenv/versions/3.12.2/envs/cambridge/lib/python3.12/site-packages/cambridge/dicts/cambridge.py", line 38, in search_cambridge
    cached = dicts.cache_run(input_word, req_url)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/USERNAME/.pyenv/versions/3.12.2/envs/cambridge/lib/python3.12/site-packages/cambridge/dicts/dicts.py", line 58, in cache_run
    data = get_cache(input_word, req_url)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/USERNAME/.pyenv/versions/3.12.2/envs/cambridge/lib/python3.12/site-packages/cambridge/cache.py", line 45, in get_cache
    with con:
sqlite3.ProgrammingError: Cannot operate on a closed database.
10b14224cc commented 3 months ago
❯ camb --version
cambridge 3.10.3
mhwgoo commented 3 months ago

hello~

The past two days I did a lot of code optimizations to improve speed and reduce data copying, which happened to have solved this problem :) I intended to delay publishing this version to allow longer time to fully test it by lots of frequent usage, but to fix this, I have to publish it now. Pardon me if you find any new added bugs on this version (I tested and used for a few hours, and it was fine so far), you are warmly welcomed to let me know. Sorry for the inconvenience incurred by this problem, I didn't know sqlite would appear different from my env environment.

(venv) λ camb --version
cambridge 3.11.3
(venv) λ camb bolster

bolster verb T
UK |ˈbəʊl.stər| US |ˈboʊl.stɚ|
: to support or improve something or make it stronger
|More money is needed to bolster the industry.
|She tried to bolster my confidence/morale (= encourage me and make me feel stronger) by telling me that I had a special talent.
|They need to do something to bolster their image.

bolster noun C
UK |ˈbəʊl.stər| US |ˈboʊl.stɚ|
: a long firm cylinder-shaped pillow

FOUND "bolster" from CAMBRIDGE in cache. You can add "-f -w" to fetch the MERRIAM_WEBSTER dictionary
(venv) λ camb l -d bolster
DELETED "bolster" from CAMBRIDGE in cache successfully
(venv) λ camb bolster

bolster verb T
UK |ˈbəʊl.stər| US |ˈboʊl.stɚ|
: to support or improve something or make it stronger
|More money is needed to bolster the industry.
|She tried to bolster my confidence/morale (= encourage me and make me feel stronger) by telling me that I had a special talent.
|They need to do something to bolster their image.

bolster noun C
UK |ˈbəʊl.stər| US |ˈboʊl.stɚ|
: a long firm cylinder-shaped pillow
10b14224cc commented 3 months ago

So what I have to do?

It looks like I'm on the latest version

mhwgoo commented 3 months ago

update to the newest version which is v3.11.3

10b14224cc commented 3 months ago

oh ok I saw 3.10.3 on master and assumed that was the latest version. There is a dev branch.

Update to 3.11.3 from PyPi and fixed the issue.

Thanks!

mhwgoo commented 3 months ago

I didn't push to master because I was drafting release note after replying to you first. Now all are on github and in sync.