02-21-2013, 12:08 AM | #1 |
Addict
Posts: 223
Karma: 1057019
Join Date: Oct 2010
Device: none
|
pylib.zip and zipfile.py
Never mind, think I found the issue in the script I was digging into instead of in the run time.
I am digging a bit into an issue I am having with a script that works fine when I run it under cygwin and python 2.7.3 but fails with a BadZipFile error when used as a plugin in calibre. The zip file in question passes an InfoZip unzip -t just fine and is readable on my eink device. Doing a bit of searching I think the problem in zipfile.py was fixed in this patch ( http://hg.python.org/cpython/rev/cc3255a707c7/ ) and indeed I see that patch is applied to my cygwin installation of 2.7.3. I ran calibre in debug mode and it also seems to say it is running with 2.7.3, however when I look into the pylib.zip , the size of zipfile.pyo is 32220, while the version that works is 38423. What source version is used to make the pylib.zip file and how often is it updated? Last edited by twobits; 02-21-2013 at 02:05 AM. |
02-21-2013, 12:32 AM | #2 |
Grand Sorcerer
Posts: 12,172
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
|
Take a look at http://bazaar.launchpad.net/~kovid/c...ils/zipfile.py
|
Advert | |
|
02-21-2013, 12:53 AM | #3 | |
Addict
Posts: 223
Karma: 1057019
Join Date: Oct 2010
Device: none
|
Quote:
Thanks, that looks like it has some code to work around the same issue in it. However 39489 Stored 39489 0% 02-14-2013 21:03 da23e813 calibre/utils/zipfile.pyo Seems to be that file... the plugins use the standard python library one... 32220 Stored 32220 0% 02-14-2013 21:03 4803b4b7 zipfile.pyo that does not seem to be the normal one for 2.7.3 and is missing similar fixes.. I will try and see if I can make the plugin work with the calibre/utils one but I think the run time library one should get updated to match the normal 2.7.3 one. |
|
02-21-2013, 01:48 AM | #4 | |
Addict
Posts: 223
Karma: 1057019
Join Date: Oct 2010
Device: none
|
Quote:
and I think I found the issue, the script does some things differently when invoked as a plug in that had it passing a bad path into zipfile.py , so user error then, never mind! Sorry. Last edited by twobits; 02-21-2013 at 02:04 AM. |
|
02-21-2013, 02:05 AM | #5 |
creator of calibre
Posts: 43,866
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Why are you generating broken zip files in the first place? And if you really want to handle badly broken zip files, use the localunzip module, which extracts files ignoring the zip central record completely.
|
Advert | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Where do I get Zip.exe? | Tony_A20 | ePub | 24 | 01-26-2015 08:23 PM |
PRS-T2 Difference jailbreak.zip/rupor-jailbreak.7z & minimal-root-zeam.zip/rupor-minimal.7z? | hyperstruct | Sony Reader Dev Corner | 9 | 01-06-2013 02:05 PM |
tools_v4.8.zip | jmesar | Plugins | 2 | 03-01-2012 10:05 AM |
zip app for pe | Byzantius | enTourage eDGe | 1 | 07-26-2011 11:36 AM |
Zip support? | daruking | iRex | 2 | 08-05-2006 03:13 PM |