![]() |
#181 | |
I need a chapter break
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,042
Karma: 56058267
Join Date: Mar 2015
Location: Israel
Device: Kobo Glo
|
Quote:
it didn't delete the tmp... files in C:\...\local\Temp. Last edited by oren64; 12-01-2015 at 02:29 AM. |
|
![]() |
![]() |
![]() |
#182 | ||
Digital Amanuensis
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 727
Karma: 1446357
Join Date: Dec 2011
Location: Turin, Italy
Device: Several eReaders and tablets
|
Quote:
Quote:
If you not, then that's a (Windows) bug. I cannot reproduce it in Linux. It is quite strange, as I use the Python built-in tempfile module to create the temporary directories and files, and they are supposed to be removed automatically (EDIT for clarity: by my code) as soon as the execution ends (without errors). Are you sure that the tmp* directories you are seeing are not coming from previous executions gone bad? Just delete all of them, run penelope again, and see if a new tmp* directory persists after the execution ended. Last edited by AlPe; 12-02-2015 at 09:29 AM. |
||
![]() |
![]() |
Advert | |
|
![]() |
#183 |
I need a chapter break
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,042
Karma: 56058267
Join Date: Mar 2015
Location: Israel
Device: Kobo Glo
|
Without the -k flag it's only deleting the folder with the files(d.dict,d.ifo...), and folder with the HTML files not deleting.
despite that there is a ([DEBU]delete temp dir...), maybe you need to delete the folder after the zip file is created, but it's not a big deal to me. |
![]() |
![]() |
![]() |
#184 |
Digital Amanuensis
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 727
Karma: 1446357
Join Date: Dec 2011
Location: Turin, Italy
Device: Several eReaders and tablets
|
OK, got it. It appears to be a issue with shutil.rmtree() (the function that is supposed to remove the temporary directory) on Windows. I will investigate.
For now, the only possible workaround consists in manually purging the Temp directory. |
![]() |
![]() |
![]() |
#185 |
Digital Amanuensis
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 727
Karma: 1446357
Join Date: Dec 2011
Location: Turin, Italy
Device: Several eReaders and tablets
|
Uploaded penelope 3.1.1(.1) to PyPI, including a workaround for forcing the removal of temp directories on Windows. Try upgrading:
> pip install penelope --upgrade and see it works for you. |
![]() |
![]() |
Advert | |
|
![]() |
#186 |
I need a chapter break
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,042
Karma: 56058267
Join Date: Mar 2015
Location: Israel
Device: Kobo Glo
|
Almost it delete the HTML files except to 21 files.
Edit:files belong to English-Hebrew dictionary, I try with English dictionary and the folder deleted. Last edited by oren64; 12-02-2015 at 02:19 PM. |
![]() |
![]() |
![]() |
#187 |
Digital Amanuensis
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 727
Karma: 1446357
Join Date: Dec 2011
Location: Turin, Italy
Device: Several eReaders and tablets
|
Woah... now it seems that the problem is that those file names contain accented (i.e., not ASCII-7) letters. I guess I will need to dig the Python os documentation and hacks...
|
![]() |
![]() |
![]() |
#188 |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 529
Karma: 64554
Join Date: Aug 2013
Device: Kobo Glo, GloHD
|
Wellcome to the Python's 2.x unicode nightmare...
The way I do it, is to rename all the temp filenames to ascii - do what I want with them and rename them back to the original name. |
![]() |
![]() |
![]() |
#189 |
Digital Amanuensis
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 727
Karma: 1446357
Join Date: Dec 2011
Location: Turin, Italy
Device: Several eReaders and tablets
|
Since v3.0, Penelope works with both Python 2.7.x and 3.x.
It looks more like a shell encoding problem. I tried reproducing oren64's issue on a Windows Vista machine (I do not have a more recent Windows machine), and with Python 2.7.x I was not able to, penelope v3.1.1 worked as expected, including cleaning up all the temporary files. I also tried changing the windows prompt encoding using chcp and it still worked as expected, also with ??.html files containing non-ASCII characters. Then, I thought the bug was with Python 3.5 only. I tried installing it on the same Vista machine, but I was not able to run it since it complains about a missing DLL, and I gave up on it. Yeah, maybe the workaround "rename the ??.html files to say 99.html before removing them" works, but I would like to be able to reproduce the issue and understand it, before throwing in random hacks. @oren64: sorry, but for now you need to clean your Temp manually. What is the output of > chcp (It should print the current shell encoding) Can you try changing it to latin1 and try again? > chcp 850 Have you tried using Python 2.7.x instead? |
![]() |
![]() |
![]() |
#190 |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 529
Karma: 64554
Join Date: Aug 2013
Device: Kobo Glo, GloHD
|
The killer combination is Python 2.x on Windows trying anything with command line (popen).
I think its a known bug, but they don't fix it since they don't really support 2.x versions anymore... ... or at least that was my conclusion when I had hit the same wall. Any other solution would be really appreciated. |
![]() |
![]() |
![]() |
#191 | |
I need a chapter break
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,042
Karma: 56058267
Join Date: Mar 2015
Location: Israel
Device: Kobo Glo
|
Quote:
I don't understand what to do with "chcp" where and how do i use it? Last edited by oren64; 12-03-2015 at 01:42 PM. |
|
![]() |
![]() |
![]() |
#192 | |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 529
Karma: 64554
Join Date: Aug 2013
Device: Kobo Glo, GloHD
|
Quote:
It tells you what is the code page that the terminal is using. To change it, type chcp, the desired code page number and hit enter. |
|
![]() |
![]() |
![]() |
#193 | ||
I need a chapter break
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,042
Karma: 56058267
Join Date: Mar 2015
Location: Israel
Device: Kobo Glo
|
Quote:
I tried all the Latin i can find 850,858,852,1252... , and it didn't work. if i exit cmd.exe and open it again it go back to 862. EDIT: I tried to install penelope on 3.4.3 and get an error. Quote:
Last edited by oren64; 12-03-2015 at 03:40 PM. |
||
![]() |
![]() |
![]() |
#194 |
Digital Amanuensis
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 727
Karma: 1446357
Join Date: Dec 2011
Location: Turin, Italy
Device: Several eReaders and tablets
|
Now I am a bit confused.
Forget about the issue with the Temp/ files not being deleted, and the fact that there is an error installing Python 3.x. I understand the following: 1. You installed Python 2.7.x and penelope 2. Using Python 2.7.x, you generated the dictionary you attached in the previous post 3. There are some files in Temp/ that are not deleted by Penelope Now: A. Is the dictionary file output in 2. working? If so, you are good. B. About issue 3. : just delete them manually or periodically use the Windows "cleanup" tool (I do not know how it is called now --- it deletes all the temporary directories in the system). I understand it is inconvenient, but I cannot fix the issue if I cannot reproduce it: i) On my Vista machine, ii) with Python 2.7.x and iii) penelope v3.1.1 and iv) the non-ASCII-files you provided a few posts ago and v) chcp=850, my temporary files got deleted as expected. ![]() (In the weekend I will try using chcp=862 and see if I can reproduce the bug.) Last edited by AlPe; 12-04-2015 at 08:48 AM. |
![]() |
![]() |
![]() |
#195 | ||
I need a chapter break
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,042
Karma: 56058267
Join Date: Mar 2015
Location: Israel
Device: Kobo Glo
|
Quote:
3) it didn't delete the Temp folder in C:\...\lokal\temp, with Html files in Chinese (141 files), it only deleted (words,1.html, b.html). I also tried Hebrew-Hebrew dictionary and it delete the temp folder. Quote:
|
||
![]() |
![]() |
![]() |
Tags |
kobo dictionaries |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
New custom English dictionaries | ShellShock | Kobo Developer's Corner | 166 | 09-22-2020 02:48 PM |
Kobo desktop loading dictionaries | brudigia | Kobo Reader | 1 | 07-16-2014 12:55 PM |
Touch building custom dictionaries, especially Japanese-English | tshering | Kobo Reader | 0 | 07-12-2012 06:00 PM |
Custom dictionaries for 350/650? | 1drey | Sony Reader | 5 | 12-28-2010 12:49 PM |
non-English dictionaries in eReader on iPod Touch? | ficbot | Reading and Management | 1 | 10-11-2008 09:04 AM |