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

Zim to Stardict: FileNotFoundError #585

Open
Steven630 opened this issue Sep 17, 2024 · 10 comments
Open

Zim to Stardict: FileNotFoundError #585

Steven630 opened this issue Sep 17, 2024 · 10 comments
Labels

Comments

@Steven630
Copy link

I have updated to 4.7.1 and got the following error:

[INFO] Automatically switching to SQLite mode for writing Stardict
[INFO] Using sortKeyName = 'stardict'
[INFO] Removing and re-creating 'C:\Users\64087\AppData\Local\PyGlossary\Cache\wiktionary_en_simple_all_nopic_2024-06.zim.db'
[WARNING] Unsupported operating system (no os.statvfs)
[WARNING] Unrecognized mimetype='undefined'
[WARNING] Unrecognized mimetype='undefined'
[WARNING] Unrecognized mimetype='undefined'
[ERROR] resource title: mw/skins.minerva.base.reset|skins.minerva.content.styles|ext.cite.style|site.styles|mobile.app.pagestyles.android|mediawiki.page.gallery.styles|mediawiki.skinning.content.parsoid.css
[ERROR] Exception in Tkinter callback:
Traceback (most recent call last):
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\ui\ui_tk.py", line 197, in CallWrapper__call__
return self.func(*args)
^^^^^^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\ui\ui_tk.py", line 1489, in convert
finalOutputFile = self.glos.convert(
^^^^^^^^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 1274, in convert
return self.convertV2(args)
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 1216, in convertV2
sort = self._convertPrepare(
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 1170, in _convertPrepare
if not self._read(
^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 767, in _read
self.loadReader(reader)
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 785, in loadReader
for entry in self.applyEntryFiltersGen(reader):
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 439, in applyEntryFiltersGen
for entry in gen:
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\plugins\zimfile.py", line 198, in iter
yield glos.newDataEntry(word, b_content)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 613, in newDataEntry
return DataEntry(
^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\entry.py", line 55, in init
with open(tmpPath, "wb") as toFile:
^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\64087\AppData\Local\PyGlossary\Cache\wiktionary_en_simple_all_nopic_2024-06.zim_res\mw_skins.minerva.base.reset|skins.minerva.content.styles|ext.cite.style|site.styles|mobile.app.pagestyles.android|mediawiki.page.gallery.styles|mediawiki.skinning.content.parsoid.css'
Traceback (most recent call last):
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\ui\ui_tk.py", line 197, in CallWrapper__call
return self.func(*args)
^^^^^^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\ui\ui_tk.py", line 1489, in convert
finalOutputFile = self.glos.convert(
^^^^^^^^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 1274, in convert
return self.convertV2(args)
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 1216, in convertV2
sort = self._convertPrepare(
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 1170, in _convertPrepare
if not self._read(
^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 767, in _read
self.loadReader(reader)
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 785, in loadReader
for entry in self._applyEntryFiltersGen(reader):
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 439, in _applyEntryFiltersGen
for entry in gen:
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\plugins\zimfile.py", line 198, in iter
yield glos.newDataEntry(word, b_content)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\glossary_v2.py", line 613, in newDataEntry
return DataEntry(
^^^^^^^^^^
File "C:\Users\64087\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyglossary\entry.py", line 55, in init
with open(tmpPath, "wb") as toFile:
^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\64087\AppData\Local\PyGlossary\Cache\wiktionary_en_simple_all_nopic_2024-06.zim_res\mw_skins.minerva.base.reset|skins.minerva.content.styles|ext.cite.style|site.styles|mobile.app.pagestyles.android|mediawiki.page.gallery.styles|mediawiki.skinning.content.parsoid.css'

@ilius
Copy link
Owner

ilius commented Sep 17, 2024

I pushed a fix.
Please try again.

@Steven630
Copy link
Author

Sorry, I still can't upgrade. Yesterday I managed to upgrade only because you released a new version. Downloading the zip file and double-clicking "main.py" does not have any effect.

@ilius
Copy link
Owner

ilius commented Sep 18, 2024

Try Open with... then choose python.exe from Python installation dir.

@ilius
Copy link
Owner

ilius commented Oct 4, 2024

If you need help, email me.

@Steven630
Copy link
Author

If you need help, email me.

Thank you. I still could not update to the latest version. I don't have desktop at hand recently and will try again.

@ilius
Copy link
Owner

ilius commented Oct 18, 2024

I published this tag:
https://pypi.org/project/pyglossary/4.8.0rc0/

Install with pip install pyglossary==4.8.0rc0

You will need to add --pre flag if you are not giving the version.

@Steven630
Copy link
Author

Steven630 commented Oct 21, 2024

Thank you. With the latest version, the following errors occur:

https://gist.github.com/ilius/6265667667acd855d233ce3b1eaaa705

@ilius
Copy link
Owner

ilius commented Oct 21, 2024

Please add these flags to your command and try again: -v0 --read-options=text_unicode_errors=ignore

@Steven630
Copy link
Author

I use the Tkinter interface. How do I add these flags?

@ilius
Copy link
Owner

ilius commented Oct 21, 2024

Click on first Options button after selecting zim file name. Then click on Value cell for text_unicode_errors and select ignore. Then click OK and Convert.

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

No branches or pull requests

2 participants